Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    18

    Unanswered: How to input null parameter for stored procedure

    Here is my store procedure:
    CREATE PROCEDURE mysp
    (
    IN piRptCode VARCHAR(5),
    IN piFilter VARCHAR(100),
    OUT poMthFilter VARCHAR(10000),
    OUT poPortFilter VARCHAR(10000),
    OUT poType1 VARCHAR(100),
    OUT poType2 VARCHAR(100),
    OUT poCondition1 VARCHAR(100)
    )
    LANGUAGE SQL

    How can I call my store procedure from the command line with piFilter as null?
    I have tried
    db2 call mysp('L005',,?,?,?,?,?)
    or
    db2 call mysp('L005','',?,?,?,?,?)
    but both calls give me SQL0104N
    db2 call mysp('L005',' ',?,?,?,?,?)
    This works fine.

    Thx in advance.

  2. #2
    Join Date
    May 2003
    Posts
    113

    Re: How to input null parameter for stored procedure

    could you please try:
    db2 call mysp('L005',NULL,?,?,?,?,?)


    Originally posted by bbfung
    Here is my store procedure:
    CREATE PROCEDURE mysp
    (
    IN piRptCode VARCHAR(5),
    IN piFilter VARCHAR(100),
    OUT poMthFilter VARCHAR(10000),
    OUT poPortFilter VARCHAR(10000),
    OUT poType1 VARCHAR(100),
    OUT poType2 VARCHAR(100),
    OUT poCondition1 VARCHAR(100)
    )
    LANGUAGE SQL

    How can I call my store procedure from the command line with piFilter as null?
    I have tried
    db2 call mysp('L005',,?,?,?,?,?)
    or
    db2 call mysp('L005','',?,?,?,?,?)
    but both calls give me SQL0104N
    db2 call mysp('L005',' ',?,?,?,?,?)
    This works fine.

    Thx in advance.

  3. #3
    Join Date
    Nov 2003
    Posts
    18
    It works. thx.

Posting Permissions

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