Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Problems with INSERT ... RETURNING
Hi omniscient ALL!
I try to create a function like this:
CREATE OR REPLACE PROCEDURE Insert_Person_( rec_ IN OUT PERSON_T%ROWTYPE )
is
BEGIN
/* the value of some columns updated by trigger */
INSERT INTO PERSON_T( ptlname,ptfname,ptmname,ptdob )
VALUES( rec_.ptlname, rec_.ptfname, rec_.ptmname, rec_.ptdob ) RETURNING * INTO rec_;
But Oracle shows a strange message, like:
Errors for PROCEDURE INSERT_PERSON_:
LINE/COL ERROR
-------- -----------------------------------------------------------------3/2 PLS-00801: internal error [22004] 3/2 PL/SQL: SQL Statement ignored
I could resolve this problem only by enumerating all columns name instead of
using '*' and ROWTYPE record.
I mean that this is:
CREATE OR REPLACE PROCEDURE Insert_Person_( rec_ IN OUT PERSON_T%ROWTYPE )
is
BEGIN
/* the value of some columns updated by trigger */
INSERT INTO PERSON_T( ptlname,ptfname,ptmname,ptdob )
VALUES( rec_.ptlname, rec_.ptfname, rec_.ptmname, rec_.ptdob ) RETURNING ptfname, ptlname, ptmname, ptdob, ptcreat INTO rec_.ptfname, rec_.ptlname, rec_.ptmname,rec_.ptdob,rec_.ptcreat;
Sincerely yours.
Edward Received on Fri Oct 16 1998 - 18:04:34 CDT