Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

insert record type

RajeshKannaFeb 20 2013 — edited Feb 21 2013
Hi ALL,

I have Created a table emp_info with two columns. I am assigned two values to recordtype variable.
while inserting the Record into the table an compilation error is to be there.
Create table emp_info(empno number(5),ename varchar2(30));

DECLARE

l_rec emp_info%rowtype;

BEGIN

l_rec.empno := 101;
l_rec.ename := 'KING';

insert into emp_info(empno,ename)
values(l_rec);

commit;

END;
ERROR at line 11:
ORA-06550: line 10, column 35:
PL/SQL: ORA-00947: not enough values
ORA-06550: line 10, column 1:
PL/SQL: SQL Statement ignored


Can I insert the Recordtype variables with out indicating the column names. Can any one help me??
This post has been answered by Solomon Yakobson on Feb 20 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2013
Added on Feb 20 2013
6 comments
938 views