Skip to main content

Posts

Showing posts from 2012

Inroduction to ORACLE Cursor

/*Fetch Every Emloyee Details With the help of cursor*/ /*DBMS:SCOTT/TIGER:ORACLE 9i*/ SET SERVEROUTPUT ON DECLARE   VEMPNO EMP.EMPNO%TYPE;   VENAME EMP.ENAME%TYPE;   VSAL EMP.SAL%TYPE;     CURSOR CR_EMP   IS   SELECT EMPNO,ENAME,SAL FROM EMP;   BEGIN   OPEN CR_EMP;   LOOP     FETCH CR_EMP INTO VEMPNO,VENAME,VSAL;   EXIT WHEN CR_EMP%NOTFOUND;     DBMS_OUTPUT.PUT_LINE('EMPLOYEE DETAILS');      DBMS_OUTPUT.PUT_LINE('----------------');     DBMS_OUTPUT.PUT_LINE('ID: '||VEMPNO);     DBMS_OUTPUT.PUT_LINE('NAME: '||VENAME);     DBMS_OUTPUT.PUT_LINE('BASIC: '||VSAL);     DBMS_OUTPUT.PUT_LINE('----------------');   END LOOP;   CLOSE CR_EMP; END; OR /*Fetch Every Emloyee Details With the help of cursor*/ /*DBMS:SCOTT/TIGER:ORACLE 9i*/ /*WHILE LOOP*/ SET SERVEROUTPUT ON DECLARE   VEMPNO EMP.EMPNO%TYPE;   VENAME EMP.ENAME%TYPE;   VSAL EMP.SAL%TYPE;     CURSOR CR_EMP   IS   SELECT EMPNO,ENAME,SAL FROM EMP;   B

Getting Browser Information in javaScript

<html> <head> <script> function getBrowserName() { tag_link.innerHTML="You are surfing internet through  "+'<b>'+navigator.appName+'</b>'+" browser family." } </script> </head> <body onLoad="getBrowserName()"> <center> <p id="tag_link" style="font-size:30"></p> </center> </body> </html>

Standard Events of HTML and XHTML

Standard Event Attributes <body> and <frameset> Events The two attributes below can only be used in <body> or <frameset>: Attribute Value Description onload script Script to be run when a document load onunload script Script to be run when a document unload Form Events The attributes below can be used in form elements: Attribute Value Description onblur script Script to be run when an element loses focus onchange script Script to be run when an element changes onfocus script Script to be run when an element gets focus onreset script Script to be run when a form is reset onselect script Script to be run when an element is selected onsubmit script Script to be run when a form is submitted Image Events The attribute below can be used with the img element: Attribute Value Description onabort script Script to be run when loading of an image is interrupted Keyboard Events Valid in all elements except base, bdo, br, frame, f

Quick PL/SQL Variables, Cursor ... Loops

1. RUNTIME STRING/NUM PRINTING SET SERVEROUTPUT ON BEGIN DBMS_OUTPUT.PUT_LINE('ORANGE'); END; / 2. TIMESTAMP EXAMPLE SET SERVEROUTPUT ON DECLARE V_DATE TIMESTAMP; BEGIN SELECT SYSTIMESTAMP-1/24 INTO V_DATE FROM DUAL; DBMS_OUTPUT.PUT_LINE('ONE HR. AGO :: ' || V_DATE); END; / 3. TIMESTAMP EXAMPLE WITH EXCEPTION HANDELING SET SERVEROUTPUT ON DECLARE VDATE TIMESTAMP; BEGIN SELECT SYSTIMESTAMP INTO VDATE FROM DUAL; DBMS_OUTPUT.PUT_LINE(VDATE); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR'); END; / 4. LOOP & SERIES PRINTING SET SERVEROUTPUT ON DECLARE X NUMBER:=1; BEGIN LOOP EXIT WHEN X>10; DBMS_OUTPUT.PUT_LINE(X); X:=X+1; END LOOP; END; / 5. TABLE JOINING & CURSORING CREATE TABLE AUTHORS ( ID NUMBER PRIMARY KEY, FIRST_NAME VARCHAR2(50), LAST_NAME VARCHAR2(50) ); CREATE TABLE BOOKS ( ISBN CHAR(10) PRIMARY KEY, CATEGORY VARCHAR2(20), TITLE VARCHAR2(100), NUM_PAGE NUMBER, PRICE NUMB

How to install a .deb package from Ubuntu Command Line (Terminal)

How to install a .deb package from Ubuntu Command Line (Terminal) Debian (.deb) packages are the packages that are used in Ubuntu. You can install any .deb package in your system. .deb files can generally be installed from your file manager (Nautilus) merely by clicking on them, since file associations with the default installer is already set in Ubuntu. These instructions are for those who wish to install packages from the command-line terminal (Terminal). To install a downloaded Debian (Ubuntu) package (.deb): Open Terminal and type sudo dpkg -i packagename.deb To remove a Debian (Ubuntu) package (.deb): sudo dpkg -r packagename To Reconfigure/Repair an installed Debian (Ubuntu) package (.deb): sudo dpkg-reconfigure packagename