If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL - caracter substitution

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-02-04, 07:44
cfigueira cfigueira is offline
Registered User
 
Join Date: Dec 2003
Posts: 5
SQL - caracter substitution

Hi!

I have a file that has this values:
12777,85E
53873,08E
10652,47E
7493,99E
88475,70E
57497,78E

I want to make an sql statement where i substitute the 'E' by a ' '.
I made this sql but it doesn't function.

update mybibl/fichspool
set substr(fichspool, 67, 1)=' '
where substr(fichspool, 67, 1) ='E'
Token ( was not valid. Valid tokens: =.

67 is the position in the file where the caracter is.

Any suggestions?
Reply With Quote
  #2 (permalink)  
Old 09-02-04, 08:13
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Try:

update mybibl/fichspool
set fichpool = substr(fichpool,1,66) || substr(fichspool, 68)
where substr(fichspool, 67, 1) ='E'

Andy
Reply With Quote
  #3 (permalink)  
Old 09-02-04, 09:14
cfigueira cfigueira is offline
Registered User
 
Join Date: Dec 2003
Posts: 5
Thumbs up SQL - caracter substitution

Thank's, it solved!


Quote:
Originally Posted by ARWinner
Try:

update mybibl/fichspool
set fichpool = substr(fichpool,1,66) || substr(fichspool, 68)
where substr(fichspool, 67, 1) ='E'

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On