Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Posts
    56

    Unanswered: Calling a stored procedure in DB2 8.1

    I try to call a proc like this...

    call proctest(?, ?, 'doit');

    The first two args are output params (DATETIME). The last is an input param (VARCHAR).

    I get the following error:

    Error: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -313, SQLSTATE: 07004, SQLERRMC: null, SQL State: 07004, Error Code: -313

    Do I have to prep the arguments in some way before I make the call?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    The -313 may be happening inside the SP. I would look up that error message in the manual and check your SP to make sure it is written properly.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Aug 2006
    Posts
    56
    The error is : The USING clause or INTO clause is required for dynamic parameters


    I don't have access to the sp code

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by mburke

    I get the following error:

    Error: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -313, SQLSTATE: 07004, SQLERRMC: null, SQL State: 07004, Error Code: -313
    From the above I'm assuming you make your call from some Java code. It would help if you posted the code fragment where you make the call.

  5. #5
    Join Date
    Aug 2006
    Posts
    56
    Nope, I am not calling it from Java. I am using Squirrel SQL's SQL Worksheet. I also tried JDeveloper's sql tool and got the same results.

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Try it from a DB2 Command Prompt:

    db2 connect to <database-name>

    db2 "call proctest(?, ?, 'doit')"
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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