6 Replies Latest reply on Feb 21, 2013 10:33 AM by padders

    insert record type

    RajeshKanna
      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??