Home » SQL & PL/SQL » SQL & PL/SQL » want to update any character of a field
want to update any character of a field [message #220624] Wed, 21 February 2007 07:40 Go to next message
amit_vass2000
Messages: 52
Registered: December 2006
Location: Delhi
Member
Hello everybody,
in my table account_master, i have a column voucher_no whose values are like 'L00700141'.

Now i want to update the column voucher_no. i want to remove 'L' and in place of it i want to add 'U', so values look like 'U00700141'.
Plz tell me any sql query, so i can do this. Thanks in advance for ur support.
Re: want to update any character of a field [message #220626 is a reply to message #220624] Wed, 21 February 2007 07:48 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Update the column with the following
'U' || substr(voucher_no,2)
If you know 'L' is occurring only once, then you can use
translate(voucher_no,'L','U')

Also you can have a look at this.

Thanks,
Vamsi

[Updated on: Wed, 21 February 2007 08:18]

Report message to a moderator

Re: want to update any character of a field [message #220634 is a reply to message #220624] Wed, 21 February 2007 08:10 Go to previous message
amit_vass2000
Messages: 52
Registered: December 2006
Location: Delhi
Member
Thanks sir,
Previous Topic: Performance problem of connect by clause
Next Topic: Flash back Tables
Goto Forum:
  


Current Time: Sun Dec 04 21:07:43 CST 2016

Total time taken to generate the page: 0.08090 seconds