This package imports and exports a series of tePLSQL templates for the TE_TEMPLATES using XML.
Example XML Format:
<teplsql>
<templates>
<template>
<NAME>hello world</NAME>
<DESCRIPTION>This is a "Hello World" template</DESCRIPTION>
<CREATED_BY>SCOTT TIGER</CREATED_BY>
<CREATED_DATE>2016-11-19</CREATED_DATE>
<MODIFIED_BY>SCOTT TIGHER</MODIFIED_BY>
<MODIFIED_DATE>2016-11-19</MODIFIED_DATE>
<TEMPLATE>Hello World!</TEMPLATE>
</template>
</templates>
</teplsql>
- File Extenstion should be .xml or .teplsql
- DATE columns are those imported/exported via XML SQL. YYYY-MM-DD
- The Node "/teplsql/templates/template/TEMPLATE" can be CDATA type data.
- Multiple /teplsql/templates/template Nodes are expected.
This is an AUTHID CURRENT_USER package.
The caller must have appropriate INSERT/UPDATE/SELECT permission on the TE_TEMPLATES table.
For APEX:
- The 'parsing schema' needs EXECUTE permission in order to run. (This is in addtion to INSERT/SELECT/UPDATE on TE_TEMPLATES
For Oracle Directory:
- The caller needs INSERT/SELECT/UPDATE permissions on the table TE_TEMPLATES
- The caller must also have appropriate READ/WRITE permission on the Oracle Directory if the "directory_*" interfaces are used.
These functions are the main functions of the package.
xml_import
- imports an XML LOB into the TE_TEMPLATES tablexml_export
- returns the XML in CLOB format (todo: this should return an XMLType)assert
- this verifies that the XML is valid for import()
These procedures allow you to import from/export to a file using an Oracle Directoyr
file_import
- imports templates from an XML file found in an Oracle Directory.file_export
- exports templates into an XML file located in an Oracle Directory.
These procedures are for use from within Oracle Application Express (APEX)
apex_import
- use to import a file uploaded via "File Browse..." Item type into APEX_APPLICATION_TEMP_FILES. APEX 5.0 or higher is requiredapex_export
- a BEFORE HEADER process that allows the end-user to download the XML file. The Filename must end in xml or teplsql
These are Pipelined Functions that allow you to create a List of Values for your application.
import_options_lov
- returns a list of options for the import() series of proceduresexport_options_lov
- returns a list of option for the export() series of procedures
g_import_overwrite
- if NAME matches, always OVERWRITEg_import_ignore
- if NAME matches, ignoreg_import_error
- if NAME mathches, raise an error
g_export_exact
- Match p_search_values against NAME using a case insentive exact mathch.g_export_like
- Match p_search_values against NAME using a case insentive LIKE match. You must provide "%" keys.g_export_regexp
- Match p_search_values against NAME using a case sensitive Regular Expression match.