Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Experts

I am having a stored procedure contains select query. Now wat i want is in my select query the table name has to change based on the input provided. I am using vb.net and oracle database.

Thanks in advance for your help

Rgds
Jagadesh
Posted
Comments
claireg90 17-Jul-13 5:37am    
Sorry for typing a comment as a Solution.

1 solution

Hi,

Try with this,
Here i declared as variable.
U can try to pass as parameter in Stored procedure

SQL
declare
 t_name varchar2(20) := 'tableName';
begin
 execute immediate 'Select * from :1'
   using t_name;
 commit;
end
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900