MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » June 2008

Need help with SQL SET statement



fixed

I need to update a 12 characters field starting from position 6 to 9 with '0000' using interactive SQL.
First I need to check if the 12 character field starting from position 6 to 12 is blank then update this field from start position 6 with 0000.

Before MYFLD = '12345 '
After MYFLD = '123450000 '

Something like this

UPDATE MYLIB/MFFILE SET myFLD = substr(myFLD,6,4) ='0000'
where myFLD = substr(myFLD,6,8) =' '

TIA






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact