Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Updating a table :Using dynamically generated table_Names

Updating a table :Using dynamically generated table_Names

From: Vikas Kawatra <VKawatra_at_innoventry.com>
Date: Thu, 10 May 2001 14:06:15 -0700
Message-ID: <F001.0030031A.20010510140712@fatcity.com>

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). Received on Thu May 10 2001 - 16:06:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US