Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure with Substitution Type Variables? 1

Status
Not open for further replies.

Robertio

Programmer
Oct 9, 2000
87
GB
I'm sure there must be a simple way of doing this, but can't find it, so...

I have a stored procedure which I want to pass in a table name to, then run the query on this table.

ie:
insert into ivTable (select * from ivSource where ...)

Where ivTable and ivSource are both passed in.

Any ideas?

Thanks Robertio
Alias: Robbie Calder
Software Developer
urc@walkermartyn.co.uk
 
EXECUTE IMMEDIATE 'insert into ' || ivTable || ' (select * from ' || ivSource || ' where ...) ';
 
Thanks :) Robertio
Alias: Robbie Calder
Software Developer
urc@walkermartyn.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top