From 7cadfd85ef142e7a45f1b6c3f1fdc355c394d385 Mon Sep 17 00:00:00 2001 From: ogobrecht Date: Fri, 16 Aug 2019 14:57:41 +0200 Subject: [PATCH] fix error on large APEX UI install files --- PLEX.pkb | 5 +- PLEX.pks | 6 +- README.md | 200 +++++++++++++++++++++++++++--------------------------- 3 files changed, 107 insertions(+), 104 deletions(-) diff --git a/PLEX.pkb b/PLEX.pkb index da38247..e6bd8f6 100755 --- a/PLEX.pkb +++ b/PLEX.pkb @@ -1098,9 +1098,8 @@ RETURN tab_export_files IS v_export_files(i).name := 'scripts/install_frontend_generated_by_apex.sql'; v_export_files(i).contents := '-- DO NOT TOUCH THIS FILE - IT WILL BE OVERWRITTEN ON NEXT PLEX BACKAPP CALL' || c_lf || c_lf - || util_multi_replace( - v_export_files(i).contents, - '@application/', '@../' || p_base_path_frontend || '/', + || replace(replace(v_export_files(i).contents, + '@application/', '@../' || p_base_path_frontend || '/'), 'prompt --install', 'prompt --install_frontend_generated_by_apex'); END IF; -- handle build status RUN_ONLY diff --git a/PLEX.pks b/PLEX.pks index df86895..6e1bf61 100755 --- a/PLEX.pks +++ b/PLEX.pks @@ -1,6 +1,6 @@ CREATE OR REPLACE PACKAGE PLEX AUTHID current_user IS c_plex_name CONSTANT VARCHAR2(30 CHAR) := 'PLEX - PL/SQL Export Utilities'; -c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.0.1'; +c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.0.2'; c_plex_url CONSTANT VARCHAR2(40 CHAR) := 'https://github.com/ogobrecht/plex'; c_plex_license CONSTANT VARCHAR2(10 CHAR) := 'MIT'; c_plex_license_url CONSTANT VARCHAR2(60 CHAR) := 'https://github.com/ogobrecht/plex/blob/master/LICENSE.txt'; @@ -37,8 +37,10 @@ INSTALLATION CHANGELOG +- 2.0.2 (2019-08-16) + - Fixed: Function BackApp throws error on large APEX UI install files (ORA-06502: PL/SQL: numeric or value error: character string buffer too small) - 2.0.1 (2019-07-09) - - Fixed: Compile error PLS-00306: wrong number or types of arguments in call to 'REC_EXPORT_FILE', when DB version is lower then 18.1 + - Fixed: Compile error when DB version is lower then 18.1 (PLS-00306: wrong number or types of arguments in call to 'REC_EXPORT_FILE') - 2.0.0 (2019-06-20) - Package is now independend from APEX to be able to export schema object DDL and table data without an APEX installation - ATTENTION: The return type of functions BackApp and Queries_to_CSV has changed from `apex_t_export_files` to `plex.tab_export_files` diff --git a/README.md b/README.md index 195f83f..8360038 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ - - + + PL/SQL Export Utilities -======================= - -- [Package PLEX](#plex) -- [Function backapp](#backapp) -- [Procedure add_query](#add_query) -- [Function queries_to_csv](#queries_to_csv) -- [Function to_zip](#to_zip) -- [Function view_error_log](#view_error_log) -- [Function view_runtime_log](#view_runtime_log) - - -

Package PLEX

- - +======================= + +- [Package PLEX](#plex) +- [Function backapp](#backapp) +- [Procedure add_query](#add_query) +- [Function queries_to_csv](#queries_to_csv) +- [Function to_zip](#to_zip) +- [Function view_error_log](#view_error_log) +- [Function view_runtime_log](#view_runtime_log) + + +

Package PLEX

+ + PLEX was created to be able to quickstart version control for existing (APEX) apps and has currently two main functions called **BackApp** and **Queries_to_CSV**. Queries_to_CSV is used by BackApp as a helper function, but its functionality is also useful standalone. See also this resources for more information: @@ -43,8 +43,10 @@ INSTALLATION CHANGELOG +- 2.0.2 (2019-08-16) + - Fixed: Function BackApp throws error on large APEX UI install files (ORA-06502: PL/SQL: numeric or value error: character string buffer too small) - 2.0.1 (2019-07-09) - - Fixed: Compile error PLS-00306: wrong number or types of arguments in call to 'REC_EXPORT_FILE', when DB version is lower then 18.1 + - Fixed: Compile error when DB version is lower then 18.1 (PLS-00306: wrong number or types of arguments in call to 'REC_EXPORT_FILE') - 2.0.0 (2019-06-20) - Package is now independend from APEX to be able to export schema object DDL and table data without an APEX installation - ATTENTION: The return type of functions BackApp and Queries_to_CSV has changed from `apex_t_export_files` to `plex.tab_export_files` @@ -59,24 +61,24 @@ CHANGELOG - 1.1.0 (2018-09-23) - Change filter parameter from regular expression to list of like expressions for easier handling - 1.0.0 (2018-08-26) - - First public release - -SIGNATURE - -```sql + - First public release + +SIGNATURE + +```sql PACKAGE PLEX AUTHID current_user IS c_plex_name CONSTANT VARCHAR2(30 CHAR) := 'PLEX - PL/SQL Export Utilities'; -c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.0.1'; +c_plex_version CONSTANT VARCHAR2(10 CHAR) := '2.0.2'; c_plex_url CONSTANT VARCHAR2(40 CHAR) := 'https://github.com/ogobrecht/plex'; c_plex_license CONSTANT VARCHAR2(10 CHAR) := 'MIT'; c_plex_license_url CONSTANT VARCHAR2(60 CHAR) := 'https://github.com/ogobrecht/plex/blob/master/LICENSE.txt'; -c_plex_author CONSTANT VARCHAR2(20 CHAR) := 'Ottmar Gobrecht'; -``` - - -

Function backapp

- - +c_plex_author CONSTANT VARCHAR2(20 CHAR) := 'Ottmar Gobrecht'; +``` + + +

Function backapp

+ + Get a file collection of an APEX application (or the current user/schema only) including: - The app export SQL files splitted ready to use for version control and deployment @@ -166,11 +168,11 @@ WITH p_base_path_data => 'app_data')); END backapp; SELECT backapp FROM dual; -``` - -SIGNATURE - -```sql +``` + +SIGNATURE + +```sql FUNCTION backapp ( $if $$apex_installed $then -- App related options: @@ -207,13 +209,13 @@ FUNCTION backapp ( p_base_path_backend IN VARCHAR2 DEFAULT 'app_backend', -- The base path in the project root for the database DDL files. p_base_path_frontend IN VARCHAR2 DEFAULT 'app_frontend', -- The base path in the project root for the APEX UI install files. p_base_path_data IN VARCHAR2 DEFAULT 'app_data') -- The base path in the project root for the data files. -RETURN tab_export_files; -``` - - -

Procedure add_query

- - +RETURN tab_export_files; +``` + + +

Procedure add_query

+ + Add a query to be processed by the method queries_to_csv. You can add as many queries as you like. EXAMPLE @@ -225,21 +227,21 @@ BEGIN p_file_name => 'user_tables'); END; / -``` - -SIGNATURE - -```sql +``` + +SIGNATURE + +```sql PROCEDURE add_query ( p_query IN VARCHAR2, -- The query itself p_file_name IN VARCHAR2, -- File name like 'Path/to/your/file-without-extension'. - p_max_rows IN NUMBER DEFAULT 1000); -- The maximum number of rows to be included in your file. -``` - - -

Function queries_to_csv

- - + p_max_rows IN NUMBER DEFAULT 1000); -- The maximum number of rows to be included in your file. +``` + + +

Function queries_to_csv

+ + Export one or more queries as CSV data within a file collection. EXAMPLE BASIC USAGE @@ -308,24 +310,24 @@ WITH RETURN v_return; END queries_to_csv_zip; SELECT queries_to_csv_zip FROM dual; -``` - -SIGNATURE - -```sql +``` + +SIGNATURE + +```sql FUNCTION queries_to_csv ( p_delimiter IN VARCHAR2 DEFAULT ',', -- The column delimiter. p_quote_mark IN VARCHAR2 DEFAULT '"', -- Used when the data contains the delimiter character. p_header_prefix IN VARCHAR2 DEFAULT NULL, -- Prefix the header line with this text. p_include_runtime_log IN BOOLEAN DEFAULT true, -- If true, generate file plex_runtime_log.md with runtime statistics. p_include_error_log IN BOOLEAN DEFAULT true) -- If true, generate file plex_error_log.md with detailed error messages. -RETURN tab_export_files; -``` - - -

Function to_zip

- - +RETURN tab_export_files; +``` + + +

Function to_zip

+ + Convert a file collection to a zip file. EXAMPLE @@ -339,50 +341,50 @@ BEGIN p_include_object_ddl => true)); -- do something with the zip file... END; -``` - -SIGNATURE - -```sql +``` + +SIGNATURE + +```sql FUNCTION to_zip ( p_file_collection IN tab_export_files) -- The file collection to zip. -RETURN BLOB; -``` - - -

Function view_error_log

- - +RETURN BLOB; +``` + + +

Function view_error_log

+ + View the error log from the last plex run. The internal array for the error log is cleared on each call of BackApp or Queries_to_CSV. EXAMPLE ```sql SELECT * FROM TABLE(plex.view_error_log); -``` - -SIGNATURE - -```sql -FUNCTION view_error_log RETURN tab_error_log PIPELINED; -``` - - -

Function view_runtime_log

- - +``` + +SIGNATURE + +```sql +FUNCTION view_error_log RETURN tab_error_log PIPELINED; +``` + + +

Function view_runtime_log

+ + View the runtime log from the last plex run. The internal array for the runtime log is cleared on each call of BackApp or Queries_to_CSV. EXAMPLE ```sql SELECT * FROM TABLE(plex.view_runtime_log); -``` - -SIGNATURE - -```sql -FUNCTION view_runtime_log RETURN tab_runtime_log PIPELINED; -``` - - +``` + +SIGNATURE + +```sql +FUNCTION view_runtime_log RETURN tab_runtime_log PIPELINED; +``` + +