Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Updating data in VARCHAR field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sunny_io

New User


Joined: 11 Jul 2007
Posts: 68
Location: noida

PostPosted: Fri Dec 19, 2014 8:49 pm    Post subject: Updating data in VARCHAR field
Reply with quote

Hello Guru's

UPDATE table-name
SET SUBSTR(VARFIELD,10,10) = 'ABCDEFGHIJ'
WHERE SUBSTR(VARFIELD,10,10) = 'XXXXXXXXXX'

Is giving me syntax error on the SQl -104 .. ILLEGAL SYMBOL '('

My requirement is to identify and update all rows where from byte 10 to 10 in the VARCHAR field, the data is a certain predefined value.

Wondering if I can update part f the data in a VARCHAR field in SPUFI as opposed to writing an Application program for it. Any other suggestions are welcome.

The length of data would not change

Many Thanks
Sunny
Back to top
View user's profile Send private message

mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Sat Dec 20, 2014 6:51 am    Post subject:
Reply with quote

Hi ,

If I have understood your query (english) correctly may be you are looking for something like this

UPDATE table-name
SET VARFIELD = CONCAT( SUBSTR(VARFIELD,1,9),'ABCDEFGHIJ')
WHERE SUBSTR(VARFIELD,10,10) = 'XXXXXXXXXX' ;

PS: Try it at your own risk :-)

Regards,
Manoj Jadwani
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2105
Location: NY,USA

PostPosted: Tue Dec 23, 2014 2:21 am    Post subject:
Reply with quote

Manoj, Yes, that should work.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Timestamp field weird behaviour. rizwanaccy DB2 7 Wed Dec 26, 2018 4:33 pm
No new posts MQ-DATA-LENGTH is ZERO on MQGET Daniel Prosser Java & MQSeries 5 Tue Dec 18, 2018 5:41 pm
No new posts To get the count of PDS data sets whi... Vignesh Sid JCL & VSAM 4 Fri Nov 30, 2018 8:38 pm
No new posts DB2 - loading data Joshua1066 DB2 5 Sun Nov 18, 2018 4:58 am
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us