IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

update half the field of a table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Tue Jun 15, 2010 8:13 pm
Reply with quote

hi ,

how can i update just first character of a 4 character field in db2 table.
Code:
UPDATE P.P18MISC   
SET  first character of C_TYP (field name) = 'A'   
WHERE               
N_TBL = 'SPD'       
AND C_TYP LIKE 'W%';


so that W123 becomes A123
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 15, 2010 8:17 pm
Reply with quote

A Gupta,
with more than 100 posts, that means you have the experience to search.

set col = 'A' || substr(col,2,3)
or
set col = :ws-var || substr(col,2,3)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top