Skip navigation

Pass rowtype from SQL to PL/SQL

score 60
You have not voted. Active

I wish it was possible to pass a rowtype from a SQL statement to PL/SQL, like this:

 

create or replace function get_row_text (p_row in emp%rowtype) return varchar2

as

begin

  return p_row.empno || ' ' || p_row.ename;

end get_row_text;

 

select get_row_text(e.*) as the_text

from emp e

 

This currently fails with ORA-01747: invalid user.table.column, table.column, or column specification

 

See also https://twitter.com/mortenbraten/status/832642914136186884

 

- Morten

Comments

Vote history