Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Inserting PL/SQL records into a table

Inserting PL/SQL records into a table

From: John Doe <john_at_doe.com>
Date: Sun, 7 Jul 2002 20:04:08 -0400
Message-ID: <agal23$k4fc2$1@ID-80970.news.dfncis.de>


I can do

my_rec my_table%ROWTYPE;

and

select * into my_rec from my_table where rownum<2;

But I cant do

insert into my_table values (my_rec);

This is a bummer.

I want to write a dynamic procedure that takes

rec_insert(table_name_in, record_name_in)

and this procedure would query ALL_TAB_COLUMNS to get all the column names for the table and construct the appropriate INSERT statement for EXECUTE IMMEDIATE. The problem is that the record_name_in IN parameter would be a different %ROWTYPE variable depending on the table_name_in IN parameter.

How can I do this?

Thanks for any help Received on Sun Jul 07 2002 - 19:04:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US