CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    India.
    Posts
    81

    SQL Stored Procedures

    I have an SQL Stored Procedure in Oracle in which I have two out parameters and one in parameter.
    In the procedure I have a numberof select statements and one insert statements.
    How to execute those statements?
    And how to set the in parameter and recieve the out parameter?


  2. #2
    Join Date
    Dec 1999
    Location
    Chonghe, Taipei County, Taiwan, R.O.C.
    Posts
    231

    Re: SQL Stored Procedures

    I never try store procedure. You may consider the CallableStatement and the method prepareCall() in
    the class Connection. You may consider the following code snippet. This is the code that I modify
    some stuff in the book.

    CallableStatement csmt = conn.prepareCall("execute inv_report(?, ? ,?)");
    csmt.setString(1, "I am in parameter");
    csmt.registerOutParameter(2, Types.INTEGER);
    csmt.String(3, " I am the in/out parameter");
    csmt.registerOutParameter(3, Types.STRING);
    ResultSet rs = csmt.executeQuery();
    String out_3 = rs.getString(3);
    int out_2 = rs.getInt(2);



    I am not aware of how to set the store procedure in the Oracle database, Hence, I do not write down
    that. This might be the code which is used in the application which may access data via store procedure.
    you may try your case. This code snippet is never tried.

    good luck,
    Alfred Wu


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

Featured