Re: Simple (?) SQL Query.
Posted in 1995
Topics: SQL Development & Query Writing
Trevor K Staats (100355.122@CompuServe.COM) wrote:
: In Melbourne our telephone numbers will soon change from
: (03)xxx-xxxx to (039)xxx-xxxx format. We have thousands of these
: numbers stored in an informix database as part of a fault tracking
: system, and we need to change them. I have tried a few SQL
: queries, but I cannot seem to get the "SET" clause to insert the 9
: into the existing number. I am using:
: update site set phone=????
: where site.phone like "03%";
: The ???? is where I am still stumped.
: Any ideas?
: Thanks,
: Trevor Staats
: CS 100355,123
: --
: Trevor Staats - Australis Microcomputer
: 1 Keith Campbell Court
: Scoresby VIC 3179 AUSTRALIA
I think you need something like :
update site set phone = "039"||phone[3,8]
where phone like "03%"
(8 being the position of the last char to be copied; probably incorrect)
Regards.
--
-----------------------------------------------------------
Bart Van der Cruyssen Bart.VanderCruyssen@rug.ac.be
UNIVERSITY OF GHENT (BELGIUM) - Computer Science Laboratory
Technologiepark-Zwijnaarde 9, B-9052 ZWIJNAARDE, BELGIUM
tel: +32/9/264.55.09 fax: +32/9/264.58.42