Re: PL/SQL - is inserting of %ROWTYPE variable possible?

From: Martin Burbridge <pobox002_at_bebub.com>
Date: 8 Jan 2003 05:38:24 -0800
Message-ID: <45a06b65.0301080538.6f8ba1d9_at_posting.google.com>


Bogien <bogien_at_xcom.pl> wrote in message news:<3E1B57D3.DDBC8532_at_xcom.pl>...
> Hello,
>
> Suppose I have a table named "tab" with columns "a", "b", "c", "d", "e".
> Now, I declare a variable named "rec" of type "tab%ROWTYPE", which
> reflects single record of the table.
>
> Question:
> Can I insert such variable into the table in PL/SQL at once?
>
> So fat, I've been performing this task this way (doesn't look nice...):
> INSERT INTO tab (a, b, c, d, e) VALUES (rec.a, rec.b, rec.c, rec.d, rec.e);
>
> Is something like "INSERT INTO tab VALUES rec" possible?
>
> Thanks!
>
> PS. I use Oracle 9i, if it can be of any help.

Version number is always important, and if you have 9iR2 you may be in luck.

See this link,

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:5955862336193

I don't have 9i available at the moment to test.

The thing is if this processing can be done as an insert ... select then it should really be done that way instead.

Martin Received on Wed Jan 08 2003 - 14:38:24 CET

Original text of this message