Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do I update part of a field's value in SQL

Re: How do I update part of a field's value in SQL

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Tue, 9 Jan 2001 17:32:11 +0100
Message-ID: <93fegt$29j$1@s1.read.news.oleane.net>

v734> create table t (col char(7));
Table created.

v734> insert into t values ('MC1402A');
v734> commit;
v734> select * from t;

COL



MC1402A

1 row selected.

v734> update t set col='MD06'||substr(col,5) where substr(col,1,4)='MC14';

1 row updated.

v734> select * from t;

COL



MD0602A

1 row selected.

--
Have a nice day
Michel


<dthomas5_at_my-deja.com> a écrit dans le message news: 93fbog$qk6$1_at_nnrp1.deja.com...

> In a table I wish to update I have a field named BINNUM which refers to the
> location an item is stored in a stockroom. BINNUM is seven (7) characters
> long and is represented by the following example: MC1402A. The MC refers to
> the aisle the cabinet is located, the 14 refers to the cabinet number (the
> 14th one down the aisle in this case) 02 refers to the drawer number (second
> drawer from the top here) and A for the location within that drawer.
>
> We have just finished rearranging the stockroom, so unfortunately the
> cabinets are no longer in the same place, requiring them to be renumbered
> physically and within the application. So for example MC1402A may now be
> MD0602A (drawer number and space in drawer remain the same)---I need to be
> able to change just the first four characters to a new value so that anything
> that was MC14*** is now MD06*** for the entire contents of the cabinet. I am
> not certain how this is done as an update using a wildcard--or even if that
> is the right approach. I know that in DOS I can rename a series of files and
> maintain part of the original name using a wildcard but not sure here.
>
> Thanks for the help.
>
> David Thomas
>
> david_thomas_at_udlp.com
> dthomas5_at_home.com
> jvthomas_at_welchlink.welch.jhu.edu
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Tue Jan 09 2001 - 10:32:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US