delphi 调用带返回参数和游标的oracle存储过程

时间:2022-03-29 15:51:10
oracle存储过程
PROCEDURE USP_G_CX_ZIDUAN1(YONGHUBH_IN IN CX_YH_TIAOJIAN.YONGHUBH%TYPE,
                           FUWUJGBH_IN IN CX_YH_TIAOJIAN.FUWUJGBH%TYPE,
                           MINGCHENGBH_IN CX_YH_TIAOJIAN.MINGCHENGBH%TYPE,
                           APPCODE_OUT OUT NUMBER,
                           DATABUFFER_OUT OUT VARCHAR2,
                           RESULTLIST_OUT OUT sys_refcursor)
既有单个返回参数又有游标数据集,在delphi中咋接收啊,SOS

6 个解决方案

#2


create or replace procedure USP_G_CX_ZIDUAN1(YONGHUBH_IN IN number,
                          FUWUJGBH_IN IN varchar2,
                          APPCODE_OUT OUT NUMBER,
                          DATABUFFER_OUT OUT VARCHAR2,
                          RESULTLIST_OUT OUT sys_refcursor)  is
begin
APPCODE_OUT:=YONGHUBH_IN;
DATABUFFER_OUT:=FUWUJGBH_IN;
open RESULTLIST_OUT for 
     select * from test1;
end USP_G_CX_ZIDUAN1;


  
with self.ADOStoredProc1 do
  begin
    //Provider=MSDAORA.1;Password=manager;User ID=system;Data Source=orcl;Persist Security Info=True
    Connection:= self.ADOConnection1;
    ProcedureName:='USP_G_CX_ZIDUAN1';
    Parameters.Clear;
    Parameters.CreateParameter('YONGHUBH_IN',ftInteger,pdInput,4,100);
    Parameters.CreateParameter('FUWUJGBH_IN',ftString,pdInput,4,'fasd');
    Parameters.CreateParameter('APPCODE_OUT',ftInteger,pdoutput,4,0);
    Parameters.CreateParameter('DATABUFFER_OUT',ftString,pdoutput,4,'');
    Open;
    showmessage(Parameters.ParamValues['DATABUFFER_OUT']);
  end;

#3


ban帮顶一下。。

#4


离开oracle已经很多年!
但基本上都是一样的,无论有多少个参数,在Delphi中都需要赋值!

#5


帮顶!

#6


jf

#1


#2


create or replace procedure USP_G_CX_ZIDUAN1(YONGHUBH_IN IN number,
                          FUWUJGBH_IN IN varchar2,
                          APPCODE_OUT OUT NUMBER,
                          DATABUFFER_OUT OUT VARCHAR2,
                          RESULTLIST_OUT OUT sys_refcursor)  is
begin
APPCODE_OUT:=YONGHUBH_IN;
DATABUFFER_OUT:=FUWUJGBH_IN;
open RESULTLIST_OUT for 
     select * from test1;
end USP_G_CX_ZIDUAN1;


  
with self.ADOStoredProc1 do
  begin
    //Provider=MSDAORA.1;Password=manager;User ID=system;Data Source=orcl;Persist Security Info=True
    Connection:= self.ADOConnection1;
    ProcedureName:='USP_G_CX_ZIDUAN1';
    Parameters.Clear;
    Parameters.CreateParameter('YONGHUBH_IN',ftInteger,pdInput,4,100);
    Parameters.CreateParameter('FUWUJGBH_IN',ftString,pdInput,4,'fasd');
    Parameters.CreateParameter('APPCODE_OUT',ftInteger,pdoutput,4,0);
    Parameters.CreateParameter('DATABUFFER_OUT',ftString,pdoutput,4,'');
    Open;
    showmessage(Parameters.ParamValues['DATABUFFER_OUT']);
  end;

#3


ban帮顶一下。。

#4


离开oracle已经很多年!
但基本上都是一样的,无论有多少个参数,在Delphi中都需要赋值!

#5


帮顶!

#6


jf