fix error on large APEX UI install files

This commit is contained in:
ogobrecht 2019-08-16 14:57:41 +02:00
parent e7d512f6db
commit 7cadfd85ef
3 changed files with 107 additions and 104 deletions

View File

@ -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

View File

@ -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`

200
README.md
View File

@ -1,20 +1,20 @@
<!-- DO NOT EDIT THIS FILE DIRECTLY - it is generated from source file PLEX.pks -->
<!-- DO NOT EDIT THIS FILE DIRECTLY - it is generated from source file PLEX.pks -->
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)
<h2><a id="plex"></a>Package PLEX</h2>
<!----------------------------------->
=======================
- [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)
<h2><a id="plex"></a>Package PLEX</h2>
<!----------------------------------->
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';
```
<h2><a id="backapp"></a>Function backapp</h2>
<!------------------------------------------>
c_plex_author CONSTANT VARCHAR2(20 CHAR) := 'Ottmar Gobrecht';
```
<h2><a id="backapp"></a>Function backapp</h2>
<!------------------------------------------>
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;
```
<h2><a id="add_query"></a>Procedure add_query</h2>
<!----------------------------------------------->
RETURN tab_export_files;
```
<h2><a id="add_query"></a>Procedure add_query</h2>
<!----------------------------------------------->
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.
```
<h2><a id="queries_to_csv"></a>Function queries_to_csv</h2>
<!-------------------------------------------------------->
p_max_rows IN NUMBER DEFAULT 1000); -- The maximum number of rows to be included in your file.
```
<h2><a id="queries_to_csv"></a>Function queries_to_csv</h2>
<!-------------------------------------------------------->
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;
```
<h2><a id="to_zip"></a>Function to_zip</h2>
<!---------------------------------------->
RETURN tab_export_files;
```
<h2><a id="to_zip"></a>Function to_zip</h2>
<!---------------------------------------->
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;
```
<h2><a id="view_error_log"></a>Function view_error_log</h2>
<!-------------------------------------------------------->
RETURN BLOB;
```
<h2><a id="view_error_log"></a>Function view_error_log</h2>
<!-------------------------------------------------------->
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;
```
<h2><a id="view_runtime_log"></a>Function view_runtime_log</h2>
<!------------------------------------------------------------>
```
SIGNATURE
```sql
FUNCTION view_error_log RETURN tab_error_log PIPELINED;
```
<h2><a id="view_runtime_log"></a>Function view_runtime_log</h2>
<!------------------------------------------------------------>
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;
```