SQL7939 is only a warning. When replacing data with the scalar function REPLACE, the result is converted into a varying data that might be longer or shorter than the fixed length of the column. If the data length do not match with result column, it is either truncated or padded with blanks. So a conversion has to be done.
... but it's just a warning!
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxx> On Behalf Of Thomas Garvey
Sent: Dienstag, 8. Januar 2019 22:57
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: SQL Update different on v7r3?
Hi,
I've got a program that is used to replace a particular value found in source members with another value.
It uses the SQL update command, as follows...
update QSQLSRC set srcdta=replace(srcdta,'oldvalue','newvalue')
This works fine on an old v5r4 box and the oldvalue and newvalue can have different lengths with no complaints from SQL.
On a v7r3 box I get an SQL7939 message, saying 'Data conversion required on INSERT or UPDATE'.
The reason code is 3 (Reason 3 is that 'the INSERT or UPDATE value is a variable length string and column SRCDTA is not').
I can't see any difference in the files between the systems. In fact, the file on v7r3 is just a transferred copy of the file from v5r4.
What am I doing wrong, or what am I ignorant of here?
Best Regards,
Thomas Garvey
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.