Select * into table%rowtype : ROWTYPE « PL SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> create table T (
  2   c1 number,
  3   c2 number );

Table created.

SQL>
SQL> insert into T values (1,2);

1 row created.

SQL>
SQL> create or replace procedure WITH_ROWTYPE is
  2     r T%ROWTYPE;
  3  begin
  4     select * into r from T where rownum = 1;
  5  end;
  6  /

Procedure created.

SQL>
SQL>
SQL> drop table t;

Table dropped.








21.27.ROWTYPE
21.27.1.Declare ROWTYPE variable
21.27.2.Reference attribute in a ROWTYPE variable
21.27.3.Select value into the %ROWTYPE type variable
21.27.4.Using a Weak REF CURSOR and %ROWTYPE
21.27.5.Defining and using a cursor-oriented record
21.27.6.INSERT statement involving entire records
21.27.7.UPDATE statement involving entire records
21.27.8.Use rowtype with object table
21.27.9.rowtype.iterations
21.27.10.Use table column type as the record attribute type
21.27.11.Select * into table%rowtype
21.27.12.PLS-00382: expression is of wrong type