Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> substitute object name with bind variables

substitute object name with bind variables

From: <geraldine_2_at_comcast.net>
Date: Tue, 11 Jan 2005 19:55:39 +0000
Message-Id: <011120051955.13402.41E42F3B000A62B80000345A2200734748CDA10A02070B040E9D0A09@comcast.net>


Is there a way to substitute object names as such table_name or view name with bind variables in the following sample code?

obviously this code does not run because I cannot substitute :b1 with tabname.table_name.

suggestions?

create or replace procedure testbind (v_id in number) as         

begin

    	for tabname in (select table_name from user_tables where table_name like 'TAB%') 
	loop
		execute immediate 'delete :b1 where id=:b2' using tabname.table_name,v_id;
	end loop;

end;
/

thanks.

geraldine

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 11 2005 - 14:00:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US