Invoking a Java Stored Procedure using SQLJ

  1. Declare and initialize input and in-out variables. For example, if the first parameter is an int input parameter:

    int bookID = scanID();
  2. Declare output variables. For example:

    int daysLate; String title;
  3. Invoke the stored procedure in a SQLJ statement. In the statement identify the parameters by name, and designate them as :in , :out, or :inout. For example:

    #sql { call NPL.CHECKIN (:in bookID, :out daysLate, :out title)}

    Return values will be assigned to output and input variables.

Invoking a Java Stored Procedure

 

Copyright © 1997, 2004, Oracle. All rights reserved.