Re: Simple (?) SQL Query.
Posted in 1995
Given a version 5.0x or later engine, you should be able to use: + CREATE TABLE site(phone CHAR(15) NOT NULL); + INSERT INTO site VALUES ('03-391-3355'); + SELECT * FROM site; 03-391-3355 + UPDATE site SET phone = phone[1,2] || '9' || phone[3,14] WHERE phone LIKE "03%"; + SELECT * FROM site; 039-391-3355 Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: Trevor K Staats <100355.122@CompuServe.COM> >Date: 3 May 1995 02:09:18 GMT >X-Informix-List-Id: <news.13570> > >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. [...]