根据用户输入更改表名 [英] Changing the table name based on user input
本文介绍了根据用户输入更改表名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨专家
我的存储过程包含选择查询。现在我想要的是在我的选择查询中,表名必须根据提供的输入进行更改。我正在使用vb.net和oracle数据库。
预先感谢您的帮助
Rgds
Jagadesh
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
推荐答案
试试这个,
这里我声明为变量。
你可以尝试在存储过程中作为参数传递
Hi,
Try with this,
Here i declared as variable.
U can try to pass as parameter in Stored procedure
declare
t_name varchar2(20) := 'tableName';
begin
execute immediate 'Select * from :1'
using t_name;
commit;
end
这篇关于根据用户输入更改表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文