Can I create a generic ROWTYPE datatype using Objects...
Hi,
I have a question regarding the use of object features inside the server.
Take a look at the following package.
PL/SQL example..
================
package my_pack is
-- Overloaded versions of P1
P1(p_emprow in emp%rowtype);
P1(p_deptrow in dept%rowtype);
end;
/
package body my_pack is
P1(p_emprow in emp%rowtype) is
begin
insert into emp values p_emprow;
end;
P1(p_deptrow in dept%rowtype) is
begin
insert into dept values p_deptrow;
end;
end;
/
Is there some object-like alternative for this?
For instance can one build something like the following?
Object-like example
===================
procedure P1(p_table_name in varchar2
,p_record in "generic_record_type_using_object_types") is
begin
execute immediate 'insert into '||p_table_name||' values :b1'
using p_record;
end;
/
So if p_table_name = 'EMP' then p_record is of type EMP%ROWTYPE, and
if p_table_name = 'DEPT' then p_record is of type DEPT%ROWTYPE.
Toon