Hw to insert a row using %RowType attributes and how to display the noof leaves taken by an employee for a given month?
Urgent............Plzzzzzz help me in dis
Collapse
X
-
TRY THE SAMPLE CODE
=============== =========
[CODE=ORACLE]
declare
var1 dept%rowtype;
begin
var1.deptno:=90 ;
var1.dname:='DE BASIS';
var1.loc:='HYD' ;
INSERT INTO DEPT VALUES VAR1;
COMMIT;
END;[/CODE]
Hope that helps you -
With version 8.1 and lower you must reference every column by name in the
insert statement value clause:
values (vrow.col1, vrow.col2, ....)
With version 9 you can insert a rowtype as a single statement as with
"values rowtype". Notice no parenthesis around the rowtype variable.
This is a 9.2 feature
The correct syntax is: INSERT INTO MYTABLE VALUES vRow;Comment
-
Originally posted by debasisdasTRY THE SAMPLE CODE
=============== =========
[CODE=ORACLE]
declare
var1 dept%rowtype;
begin
var1.deptno:=90 ;
var1.dname:='DE BASIS';
var1.loc:='HYD' ;
INSERT INTO DEPT VALUES VAR1;
COMMIT;
END;[/CODE]
Hope that helps youComment
-
Originally posted by debasisdasWith version 8.1 and lower you must reference every column by name in the
insert statement value clause:
values (vrow.col1, vrow.col2, ....)
With version 9 you can insert a rowtype as a single statement as with
"values rowtype". Notice no parenthesis around the rowtype variable.
This is a 9.2 feature
The correct syntax is: INSERT INTO MYTABLE VALUES vRow;Comment
Comment