create or replace package test
as
type refcursor is ref cursor;
end;
create or replace procedure testcursor(p_rst out test.refcursor)
as
begin
open p_rst for
select * from table;
end;
as
type refcursor is ref cursor;
end;
create or replace procedure testcursor(p_rst out test.refcursor)
as
begin
open p_rst for
select * from table;
end;
我在SqlServer中有个过程如:
CREATE PROCEDURE proc_tmp(@unit int,@bianhao char(4))
ASselect rectime,badai*100 as badai
from tsum_his_alarm
where bianhao=@bianhao and bianhao=@bianhao
这样我可以在C++Builder 中直接调用这个存储过程,
但ORACLE怎么办呢?
先谢了!
如果象你所说,是不能实现的。
CREATE OR REPLACE PACKAGE CX_InfoPhonePack
AS
TYPE curPhoneCode IS REF CURSOR RETURN YW_Info%ROWTYPE;
END;
/
CREATE OR REPLACE PROCEDURE CX_InfoPhoneProc
(iPhoneCode YW_Info.PHONECODE%type,cPhoneCode OUT CX_InfoPhonePack.curPhoneCode)
AS
BEGIN
OPEN cPhoneCode FOR
SELECT *
FROM YW_Info
WHERE (PicID>0) and (PhoneCode Like '%'||iPhoneCode||'%');
END;
/