Home » SQL & PL/SQL » SQL & PL/SQL » SQL Oracle update - append (merged by LF)
SQL Oracle update - append (merged by LF) [message #257183] Tue, 07 August 2007 13:06 Go to next message
Medchill
Messages: 5
Registered: August 2007
Junior Member
Currently, the field TS_NAME is populated with 01_001_001, 01_001_002, 01_001_003 ... 21_011_011, 21_011_012, 21_011_013.

I want to append (UPDATE) the data to be OTB_01_001_001, OTB_01_001_002, OTB_01_001_003 ... OTB_21_011_011, OTB_21_011_012, OTB_21_011_013.

How can I do so?
Re: SQL Oracle UPDATE - Append [message #257192 is a reply to message #257183] Tue, 07 August 2007 13:23 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
update <table_name> set <column_name> = <string>||<column_name> where <condition> 

[Updated on: Tue, 07 August 2007 13:24]

Report message to a moderator

Re: SQL Oracle Append UPDATE [message #257193 is a reply to message #257183] Tue, 07 August 2007 13:24 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Hope you have heard about concatenation operator.
Update the table using
set TS_NAME = 'OTB_' || TS_NAME

Edit: Don't cross post
http://www.orafaq.com/forum/t/86969/45399/

By
Vamsi

[Updated on: Tue, 07 August 2007 13:27]

Report message to a moderator

Re: SQL Oracle Append UPDATE [message #257200 is a reply to message #257193] Tue, 07 August 2007 13:36 Go to previous messageGo to next message
Medchill
Messages: 5
Registered: August 2007
Junior Member
Vamsi,

Thank you.

Steve
Re: SQL Oracle UPDATE - Append [message #257201 is a reply to message #257192] Tue, 07 August 2007 13:39 Go to previous messageGo to next message
Medchill
Messages: 5
Registered: August 2007
Junior Member
S.Rajaram,

Thank you.

Steve
Re: SQL Oracle update - append (merged by LF) [message #257216 is a reply to message #257183] Tue, 07 August 2007 15:45 Go to previous messageGo to next message
Bill B
Messages: 1482
Registered: December 2004
Senior Member
Just curious,
is the column ts_name filled with the string "01_001_001, 01_001_002, 01_001_003 ... 21_011_011, 21_011_012, 21_011_013."

or is each row contains "01_001_001" and the next row contains "01_001_002"

It makes a big difference in the fix.
Re: SQL Oracle update - append (merged by LF) [message #257239 is a reply to message #257216] Tue, 07 August 2007 18:50 Go to previous message
Medchill
Messages: 5
Registered: August 2007
Junior Member
Thank you ... I have the solution using a concatenation operator

update TEST
set TS_NAME = 'OTB_' || TS_NAME
Previous Topic: inssuficent priviliges
Next Topic: Inner and Left outer join query help
Goto Forum:
  


Current Time: Mon Dec 05 04:41:39 CST 2016

Total time taken to generate the page: 0.08605 seconds