If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Regarding User-defined function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-20-06, 22:43
boonting boonting is offline
Registered User
 
Join Date: Aug 2006
Location: Malaysia
Posts: 2
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
File Type: txt user_defined_function.txt (62.6 KB, 50 views)
Reply With Quote
  #2 (permalink)  
Old 09-21-06, 01:14
singhipst singhipst is offline
Registered User
 
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 !!**
Reply With Quote
  #3 (permalink)  
Old 09-21-06, 05:05
boonting boonting is offline
Registered User
 
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 05:09.
Reply With Quote
  #4 (permalink)  
Old 09-21-06, 07:49
singhipst singhipst is offline
Registered User
 
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 !!**
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On