请问能在客户端象使用recordset那样使用调用存储过程后的记录集吗?
如果能,请给一个例子看一看可以吗?

解决方案 »

  1.   

    可以。我曾经用Oracle数据库,写了个存储过程,然后在客户端调用此存储过程来返回记录集;
    Sql Server我不清楚。我那个存储过程大概是这样的:
    create or replace procedure Myprocedure(
    DataSet out BaseTypes.Cursortype -- BaseTypes.Cursortype是自定义的包和类型
    ) is
      V_Sql            Varchar2(2000); 
    begin
      V_Sql := '你的 select 语句';     
      open DataSet for       --这可能是和其他存储过程
        V_Sql;               --的不同之处吧
      Exception
         when others then
          Dbms_Output.Put_Line(sqlcode);
    end Myprocedure;