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: 1788
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 File Aid tool to compare numeric data balaji81_k DFSORT/ICETOOL 0 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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