Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax needed for combining & updating char fields 1

Status
Not open for further replies.

mars19301

MIS
May 31, 2001
69
US
There are over 700 id_recs (primarily schools) where the "Saint" is erroneously in the title field not in the fullname field where it belongs. I need the syntax to add St. in front of the fullname when I update the appropriate records.
OLD = Catherine High School
NEED= St. Catherine High School

See script below:

Thank you in advance
Jim
[bull]

select
id_rec.title,
id_rec.fullname,
title_table.txt
from id_rec,
outer title_table
where id_rec.title = title_table.title
and id_rec.title = "ST "
into temp bba with no log;

begin work;
update id_rec

set fullname = (("St. "),fullname) this line syntax doesn't work and is where I need the syntax

where id_rec.id in(select id from bba)
 
Hi,

Use concatenation symbol, that is, || to this value join operation as below:

begin ;
update id_rec
set fullname = ( select "St. "||fullname
from bba where id_rec.id=bba.id );
rollback;

Regards,
Shriyan
"It takes a lot of patients to be a successful doctor."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top