Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150

    Unanswered: DB2 CLI error message

    We have an application that runs on AIX that acts as a db2 client v9 FP4 talking to a database on another AIX server V9 Fp2 and we see the below error message in the log file for the application:

    2008-06-16 14:36:27 ariq_retrieval_completion.c 1099 checkSqlCodeUpdate INFO ARQ0005I SQL info: 'Update, ServiceStatus = SUCC'
    2008-06-16 14:36:27 ariq_retrieval_completion.c 1100 checkSqlCodeUpdate INFO ARQ0005I SQL info: '01004'
    2008-06-16 14:36:27 ariq_retrieval_completion.c 1101 checkSqlCodeUpdate INFO ARQ0005I SQL info: '445'
    2008-06-16 14:36:28 ariq_retrieval_completion.c 1102 checkSqlCodeUpdate INFO ARQ0005I SQL info: '[IBM][CLI Driver][DB2/AIX64] SQL0445W Value "AppEr" has been truncated. SQLSTATE=01004
    '
    2008-06-16 14:36:28 ariq_retrieval_completion.c 749 retrieval_completion INFO ARQ0017I Notification Failure

    I know this says this:

    $ db2 ? SQL0445W


    SQL0445W Value "<value>" has been truncated.

    Explanation:

    The value "<value>" was truncated when transformed in some way
    by a system (built-in) cast, adjustment, or codepage-conversion
    function. This is a warning situation.

    The value being tranformed may be one of:

    o The output of a routine (user-defined function (UDF) or
    method), and is being transformed because of a CAST FROM
    specification in the routine definition.

    o The output of a routine (user-defined function (UDF) or
    method) that is sourced on another function and the result
    needed to be transformed.

    o The output of a built-in string processing routine that
    needed to perform codepage conversion during processing, for
    example, due to a string length unit specification.



    User Response:

    Ensure that the output is as expected and that the truncation has
    not caused any unexpected consequences.

    sqlcode : +445

    sqlstate : 01004


    But am unsure what I have to do to correct the error message, any help would be appreciated

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You are trying to shove X+Y characters into a filed that is only X characters long. This is only a warning, the actual operation actually succeeds. If you want to eliminate the warning, instead of doing this:

    insert into mytable (col1,col2) values (:var1, :var2)

    do it like this:

    insert into mytable (col1,col2) values (:var1, substr(:var2,1,X))
    where X is the size of col2

    Andy

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Exactly: you do NOT have an error here. DB2 just gives you a warning, but the operation completed.

    Based on the above log entries, I suspect that your code doesn't distinguish error from warning conditions...
    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
  •