RE: SUBSTRING usage
Posted in 2000
Shouldn't the syntax be UPDATE member SET phone = SUBSTRING(phone FROM 1 FOR 3)||'-'||SUBSTRING(phone FROM 4 FOR 7) WHERE phone is NOT NULL; OR UPDATE member SET phone = SUBSTR(phone,1,3)||'-'||SUBSTR(phone,4,7) WHERE phone is NOT NULL; Cheers David -----Original Message----- From: Craig Haarmeyer [mailto:craigh@calweb.com] Sent: Friday, December 01, 2000 12:10 PM To: informix-list@iiug.org Subject: SUBSTRING usage > Hello, > I'm running ISQL 7.30 and IDS 9.2. > What I'm trying to do is put the "-"'s back into a column that stores > telephone numbers. The following is what I have tried. > Thanks, > --ch > > UPDATE member > SET phone = SUBSTRING(phone [1, 3]) > # ^ > # 201: A syntax error has occurred. > # > + '-' > + SUBSTRING(phone [4, 7]) > WHERE phone IS NOT NULL; > > > > Tried this too: > > > UPDATE member > SET phone = phone [1, 3] > + '-' > + phone [4, 7] > WHERE social IS NOT NULL; > # ^ > # 1213: Character to numeric conversion error > # ************************************************************************This e-mail is intended for the use of the individual or entity named above and may contain information that is confidential and privileged. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify us immediately at helpdesk@lumley.com.au and destroy the original message. While this mail and any attachments have been scanned for common computer viruses and found to be virus free, we recommend you also perform your own virus checking processes before opening any attachments.