Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

wrong (old) time in XML DB

araczkowskiNov 11 2022

I have a wrong ModificationDate for files stored in XML DB, checked by the code below.
How to adjust the time in XDB?

DECLARE
l_success BOOLEAN := FALSE;
l_date DATE;
BEGIN
l_success := DBMS_XDB.createresource(abspath => '/public/test.txt'
,data => 'ok');

SELECT doc_date_update
INTO l_date
FROM (SELECT any_path doc_path
,TO_DATE(REGEXP_REPLACE(REPLACE(REGEXP_REPLACE(REGEXP_SUBSTR(r.res.getclobval()
,'(<ModificationDate>.*</ModificationDate>)')
,'(<\/{0,}[[:upper:]|[:lower:]]{1,}>)'
,'')
,'T'
,' ')
,'(\.[[:digit:]]{6})'
,'')
,'YYYY-MM-DD HH24:MI:SS') doc_date_update
FROM resource_view r
WHERE UNDER_PATH(res
,'/public'
,1) = 1
ORDER BY 2 DESC)
WHERE LOWER(doc_path) LIKE '%/public/test.txt%';

dbms_output.put_line('Date on XDB ' ||
to_char(l_date
,'YYYY/MM/DD hh24:mi:ss'));
dbms_output.put_line('Date on DB ' ||
to_char(SYSDATE
,'YYYY/MM/DD hh24:mi:ss'));

DBMS_XDB.deleteresource('/public/test.txt'
,DBMS_XDB.delete_force);
COMMIT;
END;

Comments

Processing

Post Details

Added on Nov 11 2022
1 comment
184 views