Executes a group of sql files and copies "Other" files to specified destinations from a package created by the partialJdbcBuild operation.
Please note that the statements in the SQL files must be delimited properly.
The SQL Databases supported by the parser are:
- Oracle 10g+
- Using statement delimiter of ;
- PL/SQL blocks starting with DECLARE or BEGIN and finishing with END; /
- MySql 5.1+
- PostgreSql 9.0+
- Derby 10.8.2.2+
- SAP HANA
- SQL Server 2008+
- MariaDB 10.0+
- Vertica 6.5+
- H2 1.2.137+
- solidDB 6.5+
- SQL Azure
- DB2 9.7+
- AWS Redshift
- Hsql 1.8+
- Sybase ASE12.5+
- SQLite 3.7.2+
- DB2 z/OS 9.1+
- EnterpriseDB 9.4+
- Phoenix 4.2.2+
- Greenplum 4.3+
No JDBC drivers are included in the plugin, so the path to one is required (FDJDBC_DRIVER_PATH
).
Environment/Instance Properties
Property Name | Property Code | Required | Description |
---|---|---|---|
JDBC URL |
| Yes | The JDBC URL of the database. |
JDBC User |
| No | The username that will be used to connect with. |
JDBC Password |
| No | The password of the username. |
JDBC Driver Path |
| Yes | Classpath for locating the JDBC Driver (e.g. for Weblogic - |
Project Properties
Property Name | Property Code | Required | Description |
---|---|---|---|
Ignore Failure Default | FDJDBC_IGNORE_FAILURE_DEFAULT | No | When populating or evaluating files, default Ignore Failure to this. |
Property Replacement Default | FDJDBC_PROPERTY_REPLACEMENT_DEFAULT | No | When populating or evaluating files, default Property Replacement to this. |
SQL Root Target Folder | FDJDBC_SQL_ROOT_TARGET_FOLDER | No | The path to store the delivered Sql files. Sql files will be run from here. Leave blank to run them from the FD_TEMP_DIR. |
Other Root Target Folder | FDJDBC_OTHER_ROOT_TARGET_FOLDER | No | The path to store the delivered Other files. Leave blank to store them in the FD_TEMP_DIR. |
Retry Count Default | FDJDBC_RETRY_COUNT_DEFAULT | No | When populating or evaluating files, default the Retry Count to this. (0-5) |
SQL Extension Order | FDJDBC_SQL_EXTENSIONS | No | The order of sql extensions that you want to use when populating and sorting files. Files should be sorted as needed before at or before build time. Defaults to "seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc" |
Project File Includes | FD_PARTIAL_FILE_INCLUDES | No | Controls files included in Project Files. Enter expressions separated by ##. Leave empty to select all files. Begin or end the expression with * for simple wildcards. Otherwise, regex is used. (e.g. /java/*##*.java##*person*##/java/.*[tT]est.*\.java) |
Project File Excludes | FD_PARTIAL_FILE_EXCLUDES | No | Controls files excluded from Project Files. Enter expressions separated by ##. Leave empty to select all files. Begin or end the expression with * for simple wildcards. Otherwise, regex is used. (e.g. /java/*##*.java##*person*##/java/.*[tT]est.*\.java) |
Inputs
Input Name | Input Code | Required | Description |
---|---|---|---|
Run Destructive |
| No | This option allows destructive statements to be run. See Special Considerations below. |
Outputs
Output Name | Required | Description |
---|---|---|
Artifacts
This operation consumes packages of files created by the partialJdbcBuild operation.
Endpoint Selection
This operation will select all available endpoints associated to the environment/instance.
Endpoint Execution
This operation will randomly execute on one of the endpoint identified during selection.
Special Considerations
The statements in the SQL files must be delimited properly.
The FDJDBC_RUN_DESTRUCTIVE
input allows a mechanism for disallowing certain destructive SQL commands. If the input is set to true: DROP
, DELETE
, and TRUNCATE
will be allowed within the script. If the input is set to false: the plugin operation will abort with a validation error prior to running any of the commands in the script. This check cannot stop malicious actors, but instead helps to provide some security against accidental running of destructive commands. It is up to the customer to decide whether they want to allow such commands.
Sequence File for multi-file processing:
If you want to execute multiple SQL scripts, instead of specifying an SQL file within the FDJDBC_INP_FILE_NAME
input, a file containing an ordered list of SQL files to execute may be used. The plugin will detect whether a SQL file or a sequence file has been specified based on the format of the file. The format of a sequence file is as follows:
!SEQ CreateHR.sql GrantHR.sql ADFStateMgt.sql
The !SEQ
line (must be the first line) at the top of the file indicates a sequence file. After the sequence line, an ordered list of files to run follows.
Replacement Properties
The SQL files are pre-processed by the plugin to transform any defined replacement properties. An example usage of replacement properties is when the schema name cannot be hard-coded because it varies from environment to environment.
Alternative to Property Replacement
As an alternative to property replacement for dynamic schema injection, consider the use of an ALTER SESSION
command to modify the schema user which will run the statements. With this approach you need to ensure that the statements are not schema qualified.
ALTER SESSION SET current_schema=${{MYINST:MYSCHEMA}}
Where MYSCHEMA
is an environment instance property for the MYINST
instance. To achieve this you would create an environment instance-scoped property on the workflow and associate the workflow to the MYINST
instance. You will then be able to provide values for each environment associated to that instance.
Sample SQL script file
CREATE OR REPLACE PACKAGE emp_mgmt AS FUNCTION hire (last_name VARCHAR2, job_id VARCHAR2, manager_id NUMBER, salary NUMBER, commission_pct NUMBER, department_id NUMBER) RETURN NUMBER; FUNCTION create_dept(department_id NUMBER, location_id NUMBER) RETURN NUMBER; PROCEDURE remove_emp(employee_id NUMBER); PROCEDURE remove_dept(department_id NUMBER); PROCEDURE increase_sal(employee_id NUMBER, salary_incr NUMBER); PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER); no_comm EXCEPTION; no_sal EXCEPTION; END emp_mgmt; / grant execute on emp_mgmt to HR; grant execute on dept_mgmt to HR;