John Dunn wrote:
>
> I would like to be able to amend all occurences of a string in all columns
> of all rows of a table.
>
> Can I do this, without specifying individual column names?
>
> Please note that the string may include forward slashes /
>
> John
>
John,
If you do not want to specify column names then you need a 'double
action' query, eg something such as
set pause off
set echo off
set verify off
set pagesize 0
set feedback off
set recsep off
spool tally_ho.sql
select decode(rownum, 1, 'update &&my_table set ',
', ') || column_name
|| ' = replace(' || column_name
|| ', <suitable stuff>);'
from user_tab_columns
where table_name = upper('&&my_table')
and column_type in ('CHAR', 'VARCHAR2');
spool off
set echo on
set feedback on
@tally_ho
That's basically the idea.
--
Regards,
Stephane Faroult
Oriole Corporation
Voice: +44 (0) 7050-696-269
Fax: +44 (0) 7050-696-449
Performance Tools & Free Scripts
--------------------------------------------------------------
http://www.oriole.com, designed by Oracle DBAs for Oracle DBAs
--------------------------------------------------------------
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Stephane Faroult
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).