在Oracle中可以在变量中使用表名吗? 可以select * from ||test; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 TO:flyfk961(fk):我做了一试验,不知为何不行?SQL> declare 2 test varchar2(10); 3 begin 4 test:='prj_active'; 5 select * from ||test; 6 end; 7 / select * from ||test; *ERROR 位于第 5 行:ORA-06550: 第 5 行, 第 16 列:PLS-00103: 出现符号 "|"在需要下列之一时:(<an identifier><a double-quoted delimited-identifier>tablethe 用execute immediate命令解释和执行动态SQL语句SQL> declare 2 test varchar2(10); 3 begin 4 test:='prj_active'; 5 execute immediate 'select * from ' || test; 6 end; 7 / 请问: 我执行这个命令"execute immediate 'select * from ' ||test;"怎么总包错, 出现符号"select * from "当期待下列之一时: := . ( @ % ; 符号":="被替换为'select * from '后继续 公司开发只能拼SQL语句,不能用存储过程 困扰我的引号 [急]应聘sql dba通常都问什么问题? 置顶问题... 怎么在CS文件中用代码有选择的连接gridview和数据库? 有关存储过程的问题~ 请教了 更改電腦名后,sqlserver不可連,咋辦? 向sql数据库保存图片 如何增加数据库索引缓存? 想取得表中的Master Key的情况 Oracle 问题 !!!!!!!!!!!!真诚的希望能得到你们的帮助!!!!!!!!!!!!!!
2 test varchar2(10);
3 begin
4 test:='prj_active';
5 select * from ||test;
6 end;
7 /
select * from ||test;
*
ERROR 位于第 5 行:
ORA-06550: 第 5 行, 第 16 列:
PLS-00103: 出现符号 "|"在需要下列之一时:
(<an identifier>
<a double-quoted delimited-identifier>tablethe
SQL> declare
2 test varchar2(10);
3 begin
4 test:='prj_active';
5 execute immediate 'select * from ' || test;
6 end;
7 /
我执行这个命令"execute immediate 'select * from ' ||test;"怎么总包错,
出现符号"select * from "当期待下列之一时:
:= . ( @ % ;
符号":="被替换为'select * from '后继续