Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: PL/SQL - Use bind variable in "from <table>" query
OK, I figured it out, you need to create the statement as a string first using
the concat operator ||:
begin
<... pl sql code ...>
select_stmt := 'select ' || v_record_type || ' from ' || v_table_view_name || ' where ' || v_record_pk_field_name || ' = ' || new.record_pk_field_name;
execute immediate select_stmt into v_value;
<... more pl sql code ..>
end
Thanks.
--
Lyndon Tiu
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Feb 01 2005 - 00:48:37 CST