MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQLCODE -433 Trying to update a column using a UDF

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
agredell
Beginner


Joined: 04 May 2006
Posts: 27
Topics: 6

PostPosted: Tue Feb 17, 2009 12:33 pm    Post subject: SQLCODE -433 Trying to update a column using a UDF Reply with quote

DB2 V7 on Z/OS, we built UDF's to migrate between a long part number and a short part number as needed. The UDF's are working fine, converting away happily in any SELECT statement.

But, due to a program bug, some long values were stored in the short value column. As this is in a test system, I coded up a SQL statement to update where the long value is equal to the short value, to wit:

UPDATE MYDB.RESTRCTN SET RSTN_PART_NUMSHORT = MYDB.ITEML2S(RSTN_PART_NUMSHORT) WHERE RSTN_PART_NUMSHORT = RSTN_PART_NUM_LONG

DB2 complains using sql code -433; and the manual says of the "expression" in the assigment clause of the SET statement that "It must not include a column function. "

This seems most mysterious to me! I wonder how I can get my columns corrected, does anyone have any ideas?
_________________
Alan Gredell
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Feb 17, 2009 2:08 pm    Post subject: Reply with quote

agredell,

Probably a length error.

what is the length of the column RSTN_PART_NUMSHORT in MYDB.RESTRCTN table?
what is the length of the column RSTN_PART_NUMSHORT in MYDB.ITEML2S table?

I am guessing that the RSTN_PART_NUMSHORT in MYDB.ITEML2S table has a length greater than the column you are trying to update. Using SUBSTR to just extract the length of the colum in updating table.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group