RE: [PL/SQL] INSERT WITH ROWTYPE

  • From: "Powell, Mark D" <mark.powell@xxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 8 Oct 2004 12:42:01 -0400

With version 8.1 and lower you must reference every column by name in the
insert statement value clause:
values (vrow.col1, vrow.col2, ....)

With version 9 you can insert a rowtype as a single statement as with
"values rowtype".  Notice no parenthesis around the rowtype variable.

HTH -- Mark D Powell --


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Jose Manuel Quesada
Sent: Friday, October 08, 2004 7:58 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: [PL/SQL] INSERT WITH ROWTYPE


Hi all.
Environment: Oracle 8.1.7.4

Suppose I have a table MYTABLE with 40 columns.

Is there a way to code in PL/SQL an INSERT statement using a ROWTYPE
variable.

Something like this:
---------------------------------------------------
---------------------------------------------------
DECLARE
    vRow    MYTABLE%ROWTYPE;
BEGIN
    ...
    ...
    ...
    INSERT INTO MYTABLE vRow;
END;
---------------------------------------------------
---------------------------------------------------

Thanks

--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: