Database Reference
In-Depth Information
Example:
BEGIN
INSERT INTO Staff VALUES(289,'Rajiv','7-May-78','Lab Astt.', 'ECE', 'H. No 75 JP
Nag.', 'Amritsar', '');
UPDATE statement
One or more columns can be updated in one or more rows using UPDATE. It
has the following syntax:
UPDATE tablename
SET column = val1
[,column2 = val2, ... columnN = valN]
[WHERE where clause];
DELETE statement
DELETE is used to remove one, some, or all the rows in a table. It has the
following basic syntax:
DELETE FROM table
[WHERE where-clause ];
Example9:
DECLARE
Rollnum NUMBER := 110;
IS
BEGIN
DELETE FROM Student WHERE RollNo = Rollnum;
END;
Variables Initialization with SELECT INTO
SELECT INTO statement is used to initialize variables. It has the following syntax:
SELECT itemname INTO variablename
FROM tablename;
Example10:
DECLARE
studentname VARCHAR2(20);
BEGIN
SELECT Name INTO studentname
FROM student WHERE RollNo = 101;
DBMS_OUTPUT.PUT_LINE('The name of student is '|| studentname );
Search WWH ::




Custom Search