Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I need some help, as always, I currently have a table called 'notificationMessageTbl' and I have a TEXT field called 'userReadID' what I want to do is add text to the end of current text within the field using SQL

 

If I use the following code it just replaces the exsisting text with '12,' and does not append.

 

UPDATE notificationMessageTbl SET userReadID = '12,'

 

Thanks in advance

 

Simon

Posted

Unfortunately this give the following error which I think is because the field is a TEXT field not a varchar field....

 

Invalid operator for data type. Operator equals add, type equals text.

 

Thanks

 

Simon

  • Administrators
Posted (edited)

My bad - didn't read your question properly ;)

 

try

[highlight=sql]

UPDATE notificationMessageTbl SET userReadID = concat(userReadID ,'21, ')

[/highlight]

 

just out of interest is there a reason why the field has a TEXT datatype? From your code it looks like the field will contain a comma separated list - is this the case? If so could you not split these values out into another table rather than shove multiple values into a single field?

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...