Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pass a rowtype to a function in sql

PleiadianNov 13 2012 — edited Nov 13 2012
Hi all,

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0

Can you please tell me if the following is possible:

I have a function that takes a rowtype as one of the parameters and returns a varchar2
function test( pa_text in varchar2,
               pa_emp  in employee%rowtype 
  ) return varchar2
I had hoped I could use this function in a implicit cursor, something like
begin
  for c in ( select d.deptno
             ,      test(d.deptno, e.*) test
             from   emp  e
             ,      dept d
             where  e.deptno = d.deptno )
  loop
    ...
  end loop;
end;
But this results in
Error: PL/SQL: ORA-01747: invalid user.table.column, table.column, or column specification
Is something like this even possible?

Thanks!

Rob
This post has been answered by Solomon Yakobson on Nov 13 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2012
Added on Nov 13 2012
5 comments
8,958 views