Home » RDBMS Server » Server Administration » how to update part of the column data
how to update part of the column data [message #53839] Mon, 14 October 2002 14:02 Go to next message
Eugene
Messages: 44
Registered: August 2001
Member
Hi all,
I have a varchar2 column with data. I need to update it in the middle. If I issue the followith command:

update table T1
set substr(column1,100,10) = rpad('5',10,' ')

then i am getting an error message: Missing equal sign.
How do i do something like that? Is it possible?
Thanks,
Re: how to update part of the column data [message #53842 is a reply to message #53839] Mon, 14 October 2002 15:06 Go to previous message
Trifon Anguelov
Messages: 514
Registered: June 2002
Senior Member
You can create a view based on your SUBSTR() rules and then update the view.

CREATE VIEW my_view as SELECT substr(column1,100,10) "SUBSTR_COLUMN" FROM t1;

UPDATE my_view
SET sybstr_column = RPAD(...);

Hope that helps,

clio_usa
OCP - DBA

Visit our Web site

Previous Topic: maxloghistory
Next Topic: find worst queries in form of CPU usage
Goto Forum:
  


Current Time: Thu Sep 19 17:03:58 CDT 2024