Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How can we truncate/update the column values of selected rec
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    Post subject:
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    Post subject: Re: How can we truncate/update the column values of selected
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    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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us