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 > Informix > replace string help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-04, 12:28
coulterm coulterm is offline
Registered User
 
Join Date: Nov 2004
Posts: 2
Angry replace string help

I need to replace the 45th position in a string of lenght 67 and keep getting syntax errors.
Reply With Quote
  #2 (permalink)  
Old 11-16-04, 14:11
artemka artemka is offline
Registered User
 
Join Date: May 2004
Location: New York
Posts: 248
are you doing it in 4gl, store proc, or sed command?
please post your code
Reply With Quote
  #3 (permalink)  
Old 11-16-04, 15:03
coulterm coulterm is offline
Registered User
 
Join Date: Nov 2004
Posts: 2
update position within a string

I'm trying to do something like this:

set priority = replace(substring(priority from 45 for 1), 'n','8');

I'm not sure if I'm on the right track. Basically I want to replace whatever is in the 45 position with the value 8. The entire string is 67 long.

I'm using SQL Editor to update an informix db.

Thank you
Reply With Quote
  #4 (permalink)  
Old 11-19-04, 11:16
nog nog is offline
Registered User
 
Join Date: Nov 2004
Posts: 26
try using
set priority[45] = 8
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