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 > MySQL > newbie Update question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-04, 14:04
jgee jgee is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
newbie Update question

forgive the rookie nature of this question...

trying to do an update for values in a text column to append additional text string to each value, but obviously am not using the concatenation operator ( || ) correctly. here is what i tried:

UPDATE table SET columnName = columnName || ' added string ' WHERE id = XX

the result i get is that the matched columnName is reset to 0.

thanks for any help,

jgee
Reply With Quote
  #2 (permalink)  
Old 03-17-04, 18:35
vanekl vanekl is offline
Registered User
 
Join Date: Nov 2003
Posts: 91
instead of '||', try,

CONCAT(columnName, ' added string ')
Reply With Quote
  #3 (permalink)  
Old 03-27-04, 00:42
jgee jgee is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
just got around to this again and want to thank you for your post. worked perfectly!
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