CREATE OR REPLACE PROCEDURE aaaa
IS
begin
select * from test;
end;
我想用aaaa这个过程返回select * from test;的表信息
IS
begin
select * from test;
end;
我想用aaaa这个过程返回select * from test;的表信息
解决方案 »
- 一个关于Oracle的问题,急求解决
- 新手求助一个类型转换的问题
- 5行的存储过程,送分啦
- 各位大哥,我如何下载oracle9i的补丁9.2.0.6 for windows
- 请问 :做资料和图书、图片检索系统 用什么数据库?
- 一道有关数据库的考试题目,有没有高手可以回答?
- 请教将varrary 做为PROCEDUR 的OUT参数时,varrary的初始化的问题
- 写个SQL语句,快者得分。
- The Network Adapter could not establish the connection
- 奇怪問題
- Oracle数据库关于外键的on delete cascade问题
- Oracle 日期格式化问题
http://topic.csdn.net/u/20100810/10/1e161ac6-ef69-4739-8f7a-3dee85d666d5.html?17851
http://topic.csdn.net/u/20100810/10/65befff0-ebd5-4f5f-8ff0-4da561ffa57d.html?97786
http://topic.csdn.net/u/20100810/10/65befff0-ebd5-4f5f-8ff0-4da561ffa57d.html?79863
我很简单啊 我只想在存储过程里面返回一张表的信息啊! 别无他求 在SQLSERVER里面可以这样写 在PL/SQL里面不能这样写了? 那位能写个列子出来啊 帮忙
2 out_curEmp out SYS_REFCURSOR) as
3
4 begin
5 open out_curEmp for
6 SELECT * FROM emp WHERE deptno = in_deptNo ;
7 EXCEPTION
8 WHEN OTHERS THEN
9 RAISE_APPLICATION_ERROR(-20101,
10 'Error in getEmpByDept' || SQLCODE );
12 end getEmpByDept;
13 /
CREATE OR REPLACE PROCEDURE aaaa(cur1 out sys_refcursor)
IS
begin
open cur1 for select * from test;
end;--调用
declare
test_cur sys_reccursor;
test_rec test%rowtype;
v1 test.col%type;
v2 test.col2%type;
...;
begin
aaaa(test_cur);
fetch test_cur into test_rec
while test_cur%found loop
v1:=test_rec.col;
v2:=test_rec.col2;
...;
end loop;
close test_cur;
end;
declare
declare
test_cur sys_reccursor;
test_rec test%rowtype;
v1 test.col%type;
v2 test.col2%type;
...;
begin
aaaa(test_cur);
fetch test_cur into test_rec
while test_cur%found loop
v1:=test_rec.col;
v2:=test_rec.col2;
...;
fetch test_cur into test_rec;
end loop;
close test_cur;
end;
IS
begin
open cur1 for select * from secuser;
end;--调用
declare
test_cur Sys_Refcursor;
test_rec test%rowtype;
v1 secuser.logid%type;
v2 secuser.u_name%type;
--...;
begin
aaaaaaaaaaaaaaa(test_cur);
fetch test_cur into test_rec
while test_cur%found loop
v1:=test_rec.logid;
v2:=test_rec.u_name;
--...;
end loop;
close test_cur;
end;这好像也不能调用啊???
begin
for i in(select col1,col2,col3 from tb) loop
dbms_output.put_line(i.col1||','||i.col2||','||i.col3);
end loop;
end;
IS
begin
open cur1 for select logid from secuser;
end;--调用
declare
test_cur sys_reccursor;
test_rec secuser%rowtype;
v1 secuser.logid%type;
v2 secuser.u_name%type;
begin
aaaaaaaaaaaaaaa(test_cur);
fetch test_cur into test_rec
while test_cur%found loop
v1:=test_rec.logid;
v2:=test_rec.u_name;
end loop;
close test_cur;
end;调用不了 是不是那个地方写错了SQL codeCREATE OR REPLACE PROCEDURE a……
[/Quote]我在
IS
begin
open cur1 for select * from secuser;
end;--调用
declare
test_cur sys_reccursor;
test_rec secuser%rowtype;
v1 secuser.logid%type;
v2 secuser.u_name%type;
begin
aaaaaaaaaaaaaaa(test_cur);
fetch test_cur into test_rec
while test_cur%found loop
v1:=test_rec.logid;
v2:=test_rec.u_name;
end loop;
close test_cur;
end;是这个调用不了
IS
begin
open cur1 for select secuser.logid,secuser.u_name,secuser.firstname from secuser;
end;像这个我在C#里面怎么调用呢?? sys_refcursor C#怎么接受的啊??