+ Reply to Thread
Results 1 to 4 of 4

Thread: Calling RPG program from a Stored Procedure

  1. Default Calling RPG program from a Stored Procedure

    Testing a Stored Procedure that has IN/OUT or OUT parameters via STRSQL can be daunting. For that matter, I have never been able to get this to work. What does work for me is to use IBM's iSeries Navigator's "Run an SQL script". I suspect you will have much greater luck using this approach. For example, I have a stored procedure that has 4 character IN parameters and two OUT parameters (first is character, second is an integer). The OUT parameters necessitate the use of question-marks ( quoted for characters, unquoted for integers/numbers). The following is an example of the SQL script that works (in iSeries Navigator); call LIBRARY.SPNAME ('F_NAME', 'L_NAME', 'STATUS', 'Y', '?', ?); The iSeries Navigator results are as follows:
    call LIBRARY.SPNAME ('F_NAME', 'L_NAME', 'STATUS', 'Y', '?', ?);
    Output Parameter #5 = SUCCESS00 Output Parameter #6 = 62 Statement ran successfully (1732 ms) Hope this helps!

  2. #2

    Default Calling RPG program from a Stored Procedure

    The external procedure you have is just that, a procedure. Instead, 1. Create a dummy SQL external procedure (UPDSAL in example below). 2. Call your RPGLE program (GETINCR) from withing this SQL procedure. Regards, Sushanth
    Code

  3. #3
    Guest.Visitor Guest

    Default Calling RPG program from a Stored Procedure

    I am stuck. I have created an RPGLE program with 11 parms and have created the stored procedure (external), so far, so good. So, now I would like to test the stored procedure. I have tried doing the CALL from inside the STRSQL command processor with no luck. Can I NOT test the CALL to the stored procedure through the iSERIES "query analyzer"? If so, will someone explain to me what I am doing wrong? Here is the "command" I am running from inside "STRSQL": CALL CUSTOM_ALL/POL_INFO ( 'CO00004', '2006012924', '03/05/1918' ) This is the error that is returned: Routine POL_VERIFY in CUSTOM_ALL not found with specified parameters The three above are INOUT parms, I have 8 that are defined as OUT only. ALL are character. I have tried "calling" the proc with the 8 OUT parms defined as dummy parms, same message. I thought, Maybe the procedure not in the qsys2 lib files. I checked and the procedure is registered in the sysroutine file and my parms are listed in the sys parm file. I created the procedure inside the strsql processor. All help and insight is appreciated.

  4. #4
    Guest.Visitor Guest

    Default Calling RPG program from a Stored Procedure

    Jerry, thank you for your insight. I will try this. Sushantha Karanth, Your example does not fit my situation. But, thank you anyway for the SQL example.

+ Reply to Thread

Similar Threads

  1. Error calling Stored Procedure from VB6.0
    By R.Daugherty in forum Microsoft
    Replies: 2
    Last Post: 01-05-2007, 05:26 AM
  2. Calling AS/400 Stored Procedure in MS SQL Server
    By Guest.Visitor in forum SQL
    Replies: 0
    Last Post: 12-24-2003, 04:53 AM
  3. Calling Stored Procedure on the 400 using Java
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 08-01-2000, 03:49 PM
  4. Calling the stored procedure
    By Guest.Visitor in forum Programming
    Replies: 2
    Last Post: 06-21-2000, 01:54 PM
  5. Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

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