Re: cannot pass entire records to function in SQL command

From: Thomas Olszewicki <>
Date: Wed, 12 Jan 2011 06:25:32 -0800 (PST)
Message-ID: <>

>>Why is it not possible to pass the whole record to a function? <<
It is, but you are not passing a record to your function. In your code "rec" is an alias for the table tabx and not a record. Second problem, in Pl/Sql block you cannot just use "select...". You must use cursor or "select...into".
Change your code to:


   sRec tabx%rowtype;

        for i in 1..1000 loop
                insert into tabx  values (i, i);
                insert into taby  values (i, i);
        end loop;

        select * into sRec from tabx where a=1; make sure this select
fetches only one row.
        func( sRec);


Thomas Received on Wed Jan 12 2011 - 08:25:32 CST

Original text of this message