Re: SQL query question
Posted in 1992
Topics: SQL Development & Query Writing
In article <1656@das13.snide.com> dave@das13.snide.com (Dave Snyder) writes:
>In article <8718@emory.mathcs.emory.edu>, RUCHI%CFRVM.bitnet@VTVM2.CC.VT.EDU (Ruchi Patel) writes:
>
>-> Is there anyway you could delete a character from the column using the
>-> UPDATE statement? e.g. I would like to drop a "-" character from the
>-> phone_no column.
>No.
>
>DAS
>--
>David A. Snyder @ Snide Inc. - Folcroft, PA Current Release
David,
You can sort of drop one or more chars from a field using an UPDATE
in ISQL.
create temp table pnbr
(
phone_nbr CHAR(20)
);
insert into pnbr values("123-4567");
insert into pnbr values("789-0123");
update pnbr
set phone_nbr[4,8] = phone_nbr[5,8]
The table will now contain the following:
1234567
7890123
+++++++++++++++++
+++++++++++++++++++ Greg Hogg
+++ +++
++ ++ HOGG'S SOFTWARE
+++ +++
+++++++++++++++++++
+++++++++++++++++
voice : 410-538-7241
++++ ++++ ++++ ++++ fax : 410-538-6130
++++ +++++ +++++ ++++ uucp : uunet!halexii!greg
++++ ++++++ ++++++ ++++ cis : 74176,1320
--
+++++++++++++++++
+++++++++++++++++++ Greg Hogg
+++ +++