dbTalk Databases Forums  

Append text to existing field on Update

comp.databases.btrieve comp.databases.btrieve


Discuss Append text to existing field on Update in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
datenisis
 
Posts: n/a

Default Append text to existing field on Update - 02-01-2007 , 07:16 PM






I'm trying to append new text on a field using the concat function.

On the Set statement I use something like this:

Set Field = Concat(Field,'ABC')

And when I check the results 'ABC' wasn't appended to <Field>. What
should I do to make it append?


Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: Append text to existing field on Update - 02-02-2007 , 05:10 PM






When I try your query on PSQLV8.7 on a CHAR field, I get an error about
ther field being truncated.

To fix this, you have to trim the right side, as in this:
UPDATE TABLE
SET Field = CONCAT(RTRIM(Field),'ABC')

However, I made several assumptions:
1) You are running PSQLV8. Since there are numerous versions and
subversions, please remember to specify.
2) You are using a CHAR data type. If you are using VARCHAR or
LONGVARCHAR, the results may be very different.
3) You are getting an error like this. Again, if you have an error
message, please remember to specify it in your post.


If these assumptions are incorrect, please post more information.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/2007 ***


datenisis wrote:

Quote:
I'm trying to append new text on a field using the concat function.

On the Set statement I use something like this:

Set Field = Concat(Field,'ABC')

And when I check the results 'ABC' wasn't appended to <Field>. What
should I do to make it append?


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.