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 > DB2 Stored Proc Error After Upgrade

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-10, 14:10
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
DB2 Stored Proc Error After Upgrade

DB2 V9.5 FP5 - RHEL 5.2.

I have restored a database from DB2 V8.2 to V9.5 and ran
db2rbind MYDB -l logfile.txt all

It gave me an error about statement heap size then I increased the STMTHEAP size to 3072 from 2048, then it ran successfully.

My real problem is that I have a stored procedure with cursors that loads the tables by taking data from another table. This stored procedure runs without any errors on DB2 V8.2 server but it gives

"SQL0302N The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use. SQLSTATE=22001"

error on DB2 V9.5 FP5 server. I have read the explanation of the error but I can not find which statement violating the condition.

How can I run this stored procedure and find the exact statement/SQL - Table/Column is in violation ?

Thanks

Mike
Reply With Quote
  #2 (permalink)  
Old 07-30-10, 14:19
dbzTHEdinosaur dbzTHEdinosaur is offline
Registered User
 
Join Date: Jun 2007
Location: germany
Posts: 96
you could throw in consecutive handlers, checking for sqlstate 22001
and signal an ever increasing value, which would sort of be a display to indicate the statement actually returning the 22001.
__________________
Dick Brenholtz, Ami in Deutschland
Reply With Quote
  #3 (permalink)  
Old 07-30-10, 14:46
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
Thanks for the suggestion. I am not much of a programmer. I probably wouldn't know how to do that.
Reply With Quote
  #4 (permalink)  
Old 08-03-10, 09:20
wilsonfv wilsonfv is offline
Registered User
 
Join Date: Apr 2009
Posts: 42
Probably when you upgrade the database, the codeset of the db has changed, this could mean a character would take 2 char to fit instead of 1 char before. For instance, "A" would take 1 char to store, but now it needs 2 char. Thus, one of the cursor variables isnt big enough to store the value... just a thought
Reply With Quote
  #5 (permalink)  
Old 08-03-10, 09:39
dbzTHEdinosaur dbzTHEdinosaur is offline
Registered User
 
Join Date: Jun 2007
Location: germany
Posts: 96
Quote:
The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use
i would look the other way. it is the value (contents) of a host variable that is to large.
not knowing what the SP looks like, hard to guess.
__________________
Dick Brenholtz, Ami in Deutschland
Reply With Quote
  #6 (permalink)  
Old 08-03-10, 16:40
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
Thanks for all the feed back. For some strange reason droping the stored procedure and re-creating it resolved the problem................
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