这个问题比较奇怪一句很简单的动态语句居然报“无效sql语句”execute immediate 'select * from dual' ;
解决方案 »
- 帮下忙!!急!!
- 关于oracle中一个获取数字的问题!
- 求一段存储过程 如何在数组中录入指定表的属性名?
- 类似与"本周日程"的sql语句应该怎么写,请各位大侠帮忙啊
- 求一行列转换的存储过程
- 关于oracle中SQL语句中 Distinct 的用法求助!
- 在9i中,独立登陆到OEM时,为什么以任何用户名(包括数据库中不存在的)任何密码,只要指定以sysdba身份都能登进
- 请问一个SQL语句的写法
- 如何将再8.1.7上sqlplus导出的dmp导入8.1.6数据库里?
- 我想问一下谁有T.O.A.D.6.3.2.16版本可用的注册码?
- 新手问个 数据统计的问题 sum
- 这个SQLPLUS命令是什么意思啊
declare
text dual.dummy%type;
begin
execute immediate 'select * from dual' into text;
dbms_output.put_line(text);
end;
/
执行DML语句的时候,要加上INTO语法:
DECLARE
resu NUMBER(2) := 0;
BEGIN
execute immediate 'select 1 from dual' INTO resu ;
dbms_output.put_line(resu);
end;
begin
strSql:='select t1.channel_name,(';
strSql:=strSql||'select count(*) from cms_channel t where t.channel_id like ''substr(t1.channel_id,0,1)%''';
strSql:=strSql||')num from cms_channel t1 where t1.channel_level = 1';
execute immediate strSql;
end;
再帮我看一下这条数据那里有问题,看不到执行结果.java.sqlException 报无效索引列
execute immediate 'select * from dual' ;
end;
begin
strSql:='select t1.channel_name,(';
strSql:=strSql||'select count(*) from cms_channel t where t.channel_id like ''substr(t1.channel_id,0,1)%''';
strSql:=strSql||')num from cms_channel t1 where t1.channel_level = 1';
execute immediate strSql;
end;红色t1.channel_id ,表cms_channel中多行数据channel_id 的值不止一个吧,跑当行数据,右值不固定,1对N