Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2010
    Posts
    6

    Unanswered: Error calling procedure

    Hi I am trying to call procedure and getting this error while calling it.

    There was a problem getting a list: code: -408 SQLState: 42821 Message: DB2 SQL error: SQLCODE: -408, SQLSTATE: 42821, SQLERRMC: STR

    where my procedure definition is like :
    Create Procedure TESTPROC(IN str date,IN stro date)

    SQLERRMC: STR is referring to parameter 1 of the procedure.

    Can you please tell me what is wrong

    I am calling procedure like this
    CALL TESTPROC(param1,param2);

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Is there any statement like this?
    SET str = ..... ;

    You can't set str, because str is defined as IN.

  3. #3
    Join Date
    Jan 2010
    Posts
    6
    No TONKUMA

    THERE IS NO SUCH STATEMENT WHICH TRIES TO SET THE VALUE of STR;
    Is it something like parameter datatypes are not matching or something?

    Also in DB2 whenever I write this,
    Create Procedure TESTPROC(IN str VARCHAR,IN stro VARCHAR);
    it also gives me error saying DB2ADMIN.VARCHAR is an undefined name. Any idea why this would occur?

  4. #4
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    I am calling procedure like this
    CALL TESTPROC(param1,param2);
    What are the data types of param1 and param2?

    You shoud specify length for VARCHAR, like...
    VARCHAR ( integer )

    Anyway, be careful for matching of datatypes.

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The error -408 is for message SQL0408, which reads (according to the manual):
    SQL0408N A value is not compatible with the data type of its assignment
    target. Target name is "<name>".

    Explanation:

    The data type of the value to be assigned to the column, parameter, SQL
    variable, or transition variable by the SQL statement is incompatible
    with the declared data type of the assignment target. Both must be:
    * Numeric
    * Character
    * Graphic
    * Dates or character
    * Times or character
    * Timestamps or character
    * Datalinks
    * The same distinct types
    * Reference types where the target type of the value is a subtype of
    the target type of the column.
    * The same user-defined structured types. Or, the static type of the
    value must be a subtype of the static type (declared type) of the
    target. If a host variable is involved, the associated built-in type
    of the host variable must be compatible with the parameter of the TO
    SQL transform function defined in the transform group for the
    statement.

    The statement cannot be processed.

    User response:

    Examine the statement and possibly the target table or view to determine
    the target data type. Ensure the variable, expression, or literal value
    assigned has the proper data type for the assignment target. For a
    user-defined structured type, also consider the parameter of the TO SQL
    transform function defined in the transform group for the statement as
    an assignment target.

    sqlcode: -408

    sqlstate: 42821
    So you should check your stored procedure code where the problem may reside. Since you haven't shown us the code, we can't help you with that.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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