From 997548094679c7abdc4f02fa8f7f7b07a1e284f3 Mon Sep 17 00:00:00 2001 From: Ottmar Gobrecht Date: Tue, 31 Dec 2019 22:30:45 +0100 Subject: [PATCH] new function for xlsx export --- plex_install.sql | 17 +++++++++++++++++ src/PLEX.pkb | 13 +++++++++++++ src/PLEX.pks | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/plex_install.sql b/plex_install.sql index a76d2af..4fa178f 100644 --- a/plex_install.sql +++ b/plex_install.sql @@ -567,6 +567,10 @@ PROCEDURE util_setup_dbms_metadata ( PROCEDURE util_ensure_unique_file_names (p_export_files IN OUT tab_export_files); +FUNCTION util_to_xlsx_datetime ( + p_date IN DATE) +RETURN; + -------------------------------------------------------------------------------------------------------------------------------- -- The following tools are working on global private package variables -------------------------------------------------------------------------------------------------------------------------------- @@ -766,6 +770,9 @@ PROCEDURE util_setup_dbms_metadata ( p_constraints_as_alter IN BOOLEAN DEFAULT false, p_emit_schema IN BOOLEAN DEFAULT false); +FUNCTION util_to_xlsx_datetime ( + p_date IN DATE) +RETURN NUMBER; -------------------------------------------------------------------------------------------------------------------------------- -- The following tools are working on the global private package variables g_clob, g_clob_varchar_cache, g_runlog and g_queries @@ -1225,6 +1232,16 @@ END util_ensure_unique_file_names; -------------------------------------------------------------------------------------------------------------------------------- +-- https://community.oracle.com/message/1638237 +FUNCTION util_to_xlsx_datetime ( + p_date IN DATE) +RETURN NUMBER IS +BEGIN + return p_date - date '1900-01-01' + 2; +END; + +-------------------------------------------------------------------------------------------------------------------------------- + PROCEDURE util_log_init (p_module IN VARCHAR2) IS BEGIN g_runlog.module := substr(p_module, 1, c_app_info_length); diff --git a/src/PLEX.pkb b/src/PLEX.pkb index 04c21d7..5276c41 100644 --- a/src/PLEX.pkb +++ b/src/PLEX.pkb @@ -150,6 +150,9 @@ PROCEDURE util_setup_dbms_metadata ( p_constraints_as_alter IN BOOLEAN DEFAULT false, p_emit_schema IN BOOLEAN DEFAULT false); +FUNCTION util_to_xlsx_datetime ( + p_date IN DATE) +RETURN NUMBER; -------------------------------------------------------------------------------------------------------------------------------- -- The following tools are working on the global private package variables g_clob, g_clob_varchar_cache, g_runlog and g_queries @@ -609,6 +612,16 @@ END util_ensure_unique_file_names; -------------------------------------------------------------------------------------------------------------------------------- +-- https://community.oracle.com/message/1638237 +FUNCTION util_to_xlsx_datetime ( + p_date IN DATE) +RETURN NUMBER IS +BEGIN + return p_date - date '1900-01-01' + 2; +END; + +-------------------------------------------------------------------------------------------------------------------------------- + PROCEDURE util_log_init (p_module IN VARCHAR2) IS BEGIN g_runlog.module := substr(p_module, 1, c_app_info_length); diff --git a/src/PLEX.pks b/src/PLEX.pks index aa56ee4..3ba451e 100644 --- a/src/PLEX.pks +++ b/src/PLEX.pks @@ -529,6 +529,10 @@ PROCEDURE util_setup_dbms_metadata ( PROCEDURE util_ensure_unique_file_names (p_export_files IN OUT tab_export_files); +FUNCTION util_to_xlsx_datetime ( + p_date IN DATE) +RETURN; + -------------------------------------------------------------------------------------------------------------------------------- -- The following tools are working on global private package variables --------------------------------------------------------------------------------------------------------------------------------