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

How can we truncate/update the column values of selected rec


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

New User


Joined: 29 Jun 2005
Posts: 2

PostPosted: Wed Jun 29, 2005 11:14 pm
Reply with quote

For example, I have a column store where the values are of 4 digit and 5 digit values

STORE
====
100
2328
23456
222
2889
43754

I have to update the table like this.

STORE
====
100
2328
2345
222
2889
4375

Please help me do this using update SQL?
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Thu Jun 30, 2005 2:17 am
Reply with quote

vindeee

Try this out.
Code:

UPDATE your.table
SET STORE= CONCAT (SUBSTR(STORE,1,4),' ')   
;



hth
-Som
Back to top
View user's profile Send private message
vindeee

New User


Joined: 29 Jun 2005
Posts: 2

PostPosted: Thu Jun 30, 2005 10:05 am
Reply with quote

The datatype of store is numeric and not character. So usage of substring will result in sqlerror -171.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts count contained values of several col... DB2 5
No new posts Extract ISPF table column headings CLIST & REXX 2
No new posts Can BPXBATCH update TAPE file COBOL Programming 3
No new posts how to eliminate null indicator value... DB2 7
No new posts ISPF Table to add a new column TSO/ISPF 1
Search our Forums:


Back to Top