declare
strReturn CursorType;
strSql varchar2(100);
begin
strSql := 'select * from test';
open strReturn for strSql;
end;问题1:我想定义一个游标,,之后得到返回值
问题2:不用游标 用EXECUTE IMMEDIATE 执行 strSql 能不能得到返回值呢?????
注意:不用存储过程,方法!!!
ORACLE不太会,,,,跪求哥们帮下帮!!!!!!!!!!
strReturn CursorType;
strSql varchar2(100);
begin
strSql := 'select * from test';
open strReturn for strSql;
end;问题1:我想定义一个游标,,之后得到返回值
问题2:不用游标 用EXECUTE IMMEDIATE 执行 strSql 能不能得到返回值呢?????
注意:不用存储过程,方法!!!
ORACLE不太会,,,,跪求哥们帮下帮!!!!!!!!!!
解决方案 »
- CRS-0184: Cannot communicate with the CRS daemon. RAC重启错误
- oracle 11g控制台出现乱码
- 关于Oracle触发器的问题
- expdp导出,报ora-39064无法写入日志文件,怎么解决?
- 求一条SQL,请高手来解答
- 用户权限设计方案?
- 求一条group by的sql
- RedHat9.01下面安装Oracle10g2版本不对,(贴上shell代码)帮忙解决。
- 各位tx,有没有既能读写oracle8i的clob字段又能读写oracle9i的clob字段的java组件?
- ORA-12560:TNS:协议适配器错误(help me!help me...(声音嘶哑))
- oracle怎样查看当前用户下所有的序列
- oracle序列
--可以,給你個例子
--設置屏幕顯示
set serveroutput on;
--測試遊標
declare
type cur_type is ref cursor;
cur cur_type;
rec emp%rowtype;
str varchar2(50);
begin
str:= 'select ename from emp';
open cur for str;
loop
fetch cur into rec.ename;
exit when cur%notfound;
dbms_output.put_line(rec.ename);
end loop;
end;
/
这2句话是干什么用的啊?????
--設置屏幕顯示
set serveroutput on;
--測試遊標
declare
type cur_type is ref cursor;
cur cur_type;
rec test%rowtype;
str varchar2(50);
begin
str:= 'select id,value from test';
open cur for str;
loop
fetch cur into rec;
exit when cur%notfound;
dbms_output.put_line(rec.id||','||rec.ename);
end loop;
end;
/
type cur_type is ref cursor;
cur cur_type;
rec test%rowtype;
str varchar2(50);
begin
str:= 'select id,value from test';
open cur for str;
loop
fetch cur into rec;
exit when cur%notfound;
dbms_output.put_line(rec.id||','||rec.value);
end loop;
end;