Results 1 to 2 of 2

Thread: How to use record count when executing SP against oracle?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    How to use record count when executing SP against oracle?

    I have the following Stored procedure in oracle:

    create or replace procedure pogd.P_SD23_CERTIFICATE_SELECT(p_recordset out types.cursor_type) is
    begin
    open p_recordset for
    SELECT CERTIFICATE,
    CERTIFICATE_ID
    FROM SD23_CERTIFICATE;
    end P_SD23_CERTIFICATE_SELECT;


    And in my vb code I declare an adodb.command object with NO parameters and use objCOmm.execute to run the stored procedure. My dilemma now is that I can't use the recordcount property cause I don't set any cursors or declare any recordset objects in the code. I return the value from the execute right away


    public function getdata(byref conn as string) as ADODB.Recordset

    bla bla

    set getdata = objComm.Execute("P_SD23_CERTIFICATE_SELECT")
    end function


    And when I use the data I can't use recordcount....

    Is there a way to solve this? I can't execute SP with a recordset object.... and I can't just declare a recordset and set it to

    objRS = objComm.Execute("P_SD23_CERTIFICATE_SELECT")


    How can I solve this? It is kinda urgent

    kind regards
    Henrik

  2. #2
    Hyperactive Member goatsucker's Avatar
    Join Date
    Dec 2002
    Location
    Leeds, England
    Posts
    283
    Use a command object:
    VB Code:
    1. dim cmd as adodb.command
    2. dim rst as adodb.recordset
    3. dim cn as adodb.connection
    4.  
    5. set cn = new adodb.connection
    6. cn.open strconnectionString
    7.  
    8. set cmd = new adodb.command
    9.  
    10. cmd.commandtext = "P_SD23_CERTIFICATE_SELECT"
    11. cmd.commandtype = adCmdStoredProc
    12. cmd.activeconnection = cn
    13.  
    14. set rst = cmd.execute
    This code should fill the recordset rst with the contents of "P_SD23_CERTIFICATE_SELECT"
    After all "Rust Never Sleeps"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width