RE: Update records

RE: Update records

 

  

Hi : I think this will work..

SQL> select substr('TP2390349',1,2) from dual;

SU
--
TP

SQL> select replace('TP2390349','TP','00') from dual;

REPLACE('
---------
002390349

SQL> update table a set column1=replace(column,'TP','00')
2 where column1 like 'TP%'

Best Regards
Nandeesha S
Mascot Systems Ltd
Ph : 91-80-552 1701/1706 ( Extn : 4126)
Fax : 91-80-552 1704

> -----Original Message-----
> From: [Email Address Removed] [SMTP:[Email Address Removed] Sent: Friday, January 31, 2003 12:40 PM
> To: LazyDBA.com Discussion
> Subject: Update records
>
> Hi,
>
> We have a table in which one varchar field is having some different type
> of
> rows, below is the example of records....
>
> Field A
> ___________
> TP9192383
> TP2623833
> LLI3289309
> LST278238
> TP8239834
> TP2390349
> LLL9012390
>
> Now i need to update this field A , and change the records of those
> starting with 'TP%' and change these records to the rest of the values
> after 'TP' .
> Can some one help me on this.................
>
>
> Regards....
> Shailesh Kumar
> Database Administrator
>
>
>
> --------
> Oracle documentation is here:
> http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
> To unsubscribe: send a blank email to oracledba-[Email Address Removed] To subscribe: send a blank email to oracledba-[Email Address Removed] Visit the list archive: http://www.LAZYDBA.com/odbareadmail.pl
> Tell yer mates about http://www.farAwayJobs.com
> By using this list you agree to these
> terms:http://www.lazydba.com/legal.html
>
>
DISCLAIMER: Information contained and transmitted by this E-MAIL is
proprietary to Mascot Systems Limited and is intended for use only by the
individual or entity to which it is addressed, and may contain information
that is privileged, confidential or exempt from disclosure under applicable
law. If this is a forwarded message, the content of this E-MAIL may not have
been sent with the authority of the Company. If you are not the intended
recipient, an agent of the intended recipient or a person responsible for
delivering the information to the named recipient, you are notified that any
use, distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at [Email Address Removed] Before opening attachments,
please scan for viruses.


Oracle LazyDBA home page