cannot pass entire records to function in SQL command
From: Frank Bergemann <FBergemann_at_web.de>
Date: Wed, 12 Jan 2011 05:13:45 -0800 (PST)
Message-ID: <98de6e48-76c8-4ab9-9a86-b98ab5ea026c_at_j29g2000yqm.googlegroups.com>
Hi,
);
/
);
/
from tabx rec;
ERROR at line 9:
ORA-06550: line 9, column 21:
PL/SQL: ORA-00904: "REC": invalid identifier ORA-06550: line 9, column 2:
PL/SQL: SQL Statement ignored
Date: Wed, 12 Jan 2011 05:13:45 -0800 (PST)
Message-ID: <98de6e48-76c8-4ab9-9a86-b98ab5ea026c_at_j29g2000yqm.googlegroups.com>
Hi,
i wonder why this doesn't work:
- snip ----------------------------------------
set serveroutput on
drop table tabx;
/
drop table taby;
/
create table tabx (
a number, b number
);
/
create table taby (
a number, b number
);
/
drop function func;
/
create function func(rec in tabx%rowtype)
return number
is
begin
return 1;
end;
/
declare
begin
for i in 1..1000 loop insert into tabx values (i, i); insert into taby values (i, i); end loop; commit; select rec.a, func(rec)
from tabx rec;
end;
/
- snap ----------------------------------------
i get:
select rec.a, func(rec) *
ERROR at line 9:
ORA-06550: line 9, column 21:
PL/SQL: ORA-00904: "REC": invalid identifier ORA-06550: line 9, column 2:
PL/SQL: SQL Statement ignored
Why is it not possible to pass the whole record to a function?
- thanks!
rgds,
Frank
Received on Wed Jan 12 2011 - 07:13:45 CST