Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Location
    Malaysia
    Posts
    2

    Unanswered: Regarding User-defined function

    Hello, i am first time post into this forum, please guide me if i am wrong.

    i am facing problem in user-defined problem when i am trying to deploy the user-defined function from OLD database to new database.Please help me, i have no idea why the error occur.

    error:
    DBO.TO_WORD - Build started.
    Create user-defined function returns -101.
    DBO.TO_WORD: 1031: [IBM][CLI Driver][DB2/NT] SQL0101N The statement is too long or too complex. LINE NUMBER=1031. SQLSTATE=54001

    DBO.TO_WORD - Build failed.
    DBO.TO_WORD - Roll back completed successfully.

    Attached the User-defined function script.

    DB2 specification in my server
    -----------------------------
    DB2 Server workgroup edition with fixpack 7
    version no: DB2 V8.1.7.445

    Your help will be appreciated.
    Thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2006
    Location
    Bangalore
    Posts
    57
    Increase the size of the statement heap (stmtheap) in the
    database configuration file.

    I Guess then it will work........
    Ritesh Kumar Singh
    IBM Certified DB2 DBA for LUW
    **Knowledge Is Theft If Not Shared !!**

  3. #3
    Join Date
    Aug 2006
    Location
    Malaysia
    Posts
    2
    Thanks alot, it really help.The first issue solved, but now 2nd problem occur. AnyIdea ?

    TO_WORD - Run information has been updated.
    DBO.TO_WORD - Run started.
    DBO.TO_WORD - Exception occurred while running:
    [IBM][CLI Driver][DB2/NT] SQL0138N The second or third argument of the SUBSTR function is out of range. SQLSTATE=22011 DBO.TO_WORD - Roll back completed successfully.
    DBO.TO_WORD - Run failed.

    Your help will be appreciated
    Last edited by boonting; 09-21-06 at 06:09.

  4. #4
    Join Date
    Jul 2006
    Location
    Bangalore
    Posts
    57
    Check the second and third parameter of SUBSTR function
    Rules For That Are Following
    Ex First parameter is TESTING

    Means SUBSTR('TESTING',F,S)

    Then the length if first parameter is 7
    so F sould not be less then 1 or greater then 7
    And Also S should not be greator then 7

    This Will Help You Check in your Function is any place this rule is not following so that you are getting error
    Ritesh Kumar Singh
    IBM Certified DB2 DBA for LUW
    **Knowledge Is Theft If Not Shared !!**

Posting Permissions

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