Home » RDBMS Server » Server Utilities » How to import a higher TZ dump file into a lower TZ database (19c, below and higher than 19c)
|
|
|
Re: How to import a higher TZ dump file into a lower TZ database [message #689956 is a reply to message #689951] |
Fri, 16 August 2024 05:25   |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You know
while (l_wrongTZ = l_wrongTZ)
is always true right?
I'm not sure why you've written any loops there as it exits as soon as it finds something to update, and if it doesn't find anything with the wrong timezone type it'll infinite loop.
Looks to me like the whole thing reduces to this:
DECLARE
l_imptableowner varchar2(100);
begin
SELECT owner
INTO l_imptableowner
FROM dba_tables
WHERE table_name = 'SYS_IMPORT_FULL_01';
UPDATE SYS_IMPORT_FULL_01
SET property = '35'
WHERE property = '41';
IF sql%rowcount > 0 THEN
dbms_output.put_line('TZ info has been updated in '||upper(l_imptableowner)||'.SYS_IMPORT_FULL_01';
END IF;
END;
The code in your 2nd post reduces as well - for loops are wonderful things and you don't need to use obscure functions to check datatypes when you can just query dba_tab_cols:
begin
FOR rec IN (SELECT distinct table_name
FROM dba_tab_cols
where owner = '<owner>'
and data_type like 'TIMESTAMP% WITH TIME ZONE') LOOP
dbms_output.put_line(rec.table_name);
end loop;
end;
[Updated on: Fri, 16 August 2024 08:50] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 03:03:46 CDT 2025
|