Use dynamic SQL, it is so simple now that there is
execute immediate instead of prepare, execute,
bind,...
- Vikas Kawatra <VKawatra_at_innoventry.com> a écrit :
>
> can someone tell me a way to select all tables from
> multiple schemas -
> and then update records in each of these tables
> based on a certain criterea.
> I wrote a script below - which explains logically
> what I need to do - but I
> don't think I can use a cursor output in the UPDATE
> as I have below.
> Suggestions ?
>
> thanks
> vikas
>
> DECLARE
>
> CURSOR cuTab IS
> SELECT table_name,column_name
> FROM dba_tab_columns
> WHERE column_name ='END_DATE'
> AND owner='CIS';
>
> recCuTab cuTab%ROWTYPE;
>
> BEGIN
>
> FOR recCuTab IN cuTab LOOP
>
>
>
> UPDATE recCuTab.table_name --Get an error here !!
> SET end_date = TO_DATE('4712-12-31','YYYY-MM-DD')
> WHERE end_date <>
> TO_DATE('12-31-4712','mm-dd-yyyy')
> AND end_date >
> TO_DATE('1-1-4712','mm-dd-yyyy');
>
> END LOOP;
>
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Vikas Kawatra
> INET: VKawatra_at_innoventry.com
>
> 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: ListGuru_at_fatcity.com (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).
Stéphane Paquette
DBA Oracle, consultant entrepôt de données
Oracle DBA, datawarehouse consultant
stephane_paquette_at_yahoo.com
Do You Yahoo!? -- Pour faire vos courses sur le Net,
Yahoo! Shopping :
http://fr.shopping.yahoo.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: =?iso-8859-1?q?paquette=20stephane?=
INET: stephane_paquette_at_yahoo.com
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: ListGuru_at_fatcity.com (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).
Received on Fri May 11 2001 - 04:14:03 CDT