> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# packageDeploy(SQLcl)

> Executes a group of SQL files and copies "Other" files to specified destinations from a package created by the operation. See for information about th

Executes a group of SQL files and copies "Other" files to specified destinations from a package created by the [packageBuild(SQLcl)](https://docs.flexagon.com/flexdeploy-9-0-documentation/flexdeploy-plugin-guides/flexdeploy-sqlcl-plugin-guide/packagebuild-sqlcl.md) operation. See [the appendix](https://docs.flexagon.com/flexdeploy-9-0-documentation/flexdeploy-plugin-guides/flexdeploy-sqlcl-plugin-guide/appendix-sqlcl.md) for information about the project file attributes.

Please note that the statements in the SQL files must be delimited properly.

# Target Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Oracle Database User</td><td>`FDORA_USER`</td><td>Yes</td><td>The username that will be used to connect to the target Oracle Database.</td></tr><tr><td>Oracle Database Password</td><td>`FDORA_PASSWORD`</td><td>Yes</td><td>The password for Oracle Database User.</td></tr><tr><td>Oracle Database URL</td><td>`FDORA_URL`</td><td>Yes</td><td>JDBC URL for Oracle database.Connecting to Oracle Autonomous DatabaseYou will need client credential zip file (wallet) to connect with Oracle Autonomous Database on Oracle cloud. You can download wallet zip file from Oracle Cloud, you will need admin userid and password to perform this download. See [Download Client Credentials (Wallets)](https://docs.oracle.com/en-us/iaas/autonomous-database/doc/download-client-credentials.html) for more details on how to download wallet file.<ul><li>**Since FlexDeploy 9.0.0.9 with Oracle Wallet Credential Type :** Instead of maintaining the wallet zip file under the file system, you can now store the wallet zip as an Oracle Credential Type in FlexDeploy. This allows for secure storage and use of the wallet.<ul><li>Use the URL syntax in the following format: `jdbc:oracle:thin:@service_low?TNS_ADMIN={{FDORACLE_WALLET_FILE}}` is replaced with the temporary wallet folder path during execution. Once execution is completed, the temporary file is cleaned up automatically.</li></ul></li><li>**Before FlexDeploy 9.0.0.9**<ul><li>You must make sure that only authorized users have access to these wallet files. Unzip the client credentials zip file (**wallet\_*****databasename*****.zip**) on FlexDeploy server and/or endpoint where it will be used. For example, /home/flexdeploy/.wallets/\<**wallet\_*****databasename***> is folder where specific wallet file was unzipped. Make sure to secure this folder to FlexDeploy and/or Endpoint user, so that it is not readable by all users.</li><li>We recommend using Oracle Wallet Credential Type for better security and easier management of Wallet usage.</li><li>**Database URL Syntax **: jdbc:oracle:thin:@service\_high?TNS\_ADMIN=/home/flexdeploy/.wallets/\<**wallet\_*****databasename***><ul><li>service\_high is one of the entries in the tnsnames.ora file where client credentials zip file was unzipped. See [Predefined Database Service Names for Autonomous Database](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/connect-predefined-generic.html) for details on services.</li><li>TNS\_ADMIN value in URL points to the location of the **unzipped client credentials zip file**.</li></ul></li><li>**Database URL Long Connection String Format Syntax **: `jdbc:oracle:thin:@(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<hostname>))(connect_data=(service_name=<serice_name>))(security=(ssl_server_cert_dn="CN=<hostname>,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))`<ul><li>Examples for the same can be found [here](https://www.oracle.com/database/technologies/java-connectivity-to-atp.html).</li></ul></li></ul></li></ul>If using the Oracle Database Plugin with ADW or ATP databases , use the \_low connection. The \_medium and \_high connections can sometimes throw error** ORA-12839: cannot modify an object in parallel after modifying it.**</td></tr><tr><td>Oracle Wallet File</td><td>`FDORACLE_WALLET_FILE`</td><td>No</td><td>**Since 9.0.0.9** - Provide the Oracle Wallet file, see[Credential Type - Oracle Wallet](https://docs.flexagon.com/flexdeploy-9-0-documentation/flexdeploy-users-guide/administration/credentials/credential-types/credential-type-oracle-wallet.md) for more details.</td></tr><tr><td>Oracle SQLcl Home</td><td>`FD_SQLCL_HOME`</td><td>Yes</td><td>Folder where SQLcl is installed.( Ex: `/u01/install/sqlcl`)Make sure that the endpoint Java Home is a high enough version for your SQLcl version.</td></tr></tbody></table>

# Project Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>SQL Extension Order</td><td>`FDSQLCL_SQL_EXTENSIONS`</td><td>No</td><td>List SQL file extensions in desired order. Will be used for discover and sort. Files with these extensions will discover as type DB Object.</td></tr><tr><td>SQL Retry Count Default</td><td>`FDSQLCL_RETRY_COUNT_DEFAULT`</td><td>No</td><td>When discovering or evaluating files, default the Retry Count to this.</td></tr><tr><td>Stop On Deployment Error</td><td>`FDSQLCL_STOP_ON_DEPLOYMENT_ERROR`</td><td>No</td><td>Stop deploying package files if any error occurs. If unchecked all files will be deployed even if one or more files fails. This is for package operations only.</td></tr><tr><td>SQL Ignore Compile Warning Extensions</td><td>`FDSQLCL_IGNORE_COM_ERR_EXT_DEF`</td><td>No</td><td>When discovering or evaluating files, set the Ignore SQL Compilation Warning attribute to true for files with these extensions.</td></tr><tr><td>SQL Property Replacement Default</td><td>`FDSQLCL_PROPERTY_REPLACEMENT_DEFAULT`</td><td>No</td><td>When discovering or evaluating files, default Property Replacement to this.</td></tr><tr><td>SQL Root Target Folder</td><td>`FDSQLCL_SQL_ROOT_TARGET_FOLDER`</td><td>No</td><td>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`.</td></tr><tr><td>Other Root Target Folder</td><td>`FDSQLCL_OTHER_ROOT_TARGET_FOLDER`</td><td>No</td><td>The path to store the delivered Other files. Leave blank to store them in the `FD_TEMP_DIR`.</td></tr></tbody></table>

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>User Profile (login.sql)</td><td>`FDSQLCL_INP_LOGIN_SQL_FILE`</td><td>No</td><td>User Profile (login.sql) is intended to allow users to specifically customize their session.(see the [Special considerations](https://flexagon.atlassian.net/wiki/spaces/FD90/pages/10926965073/packageDeploy+SQLcl#Special-Considerations) section for examples)</td></tr><tr><td>Generate SQL Spool File</td><td>`FDSQLCL_INP_GENERATE_SPOOL_FILE`</td><td>No</td><td>Check to generate report (Spool file) of SQL statement executions.</td></tr><tr><td>Show DBMS Output</td><td>`FDSQLCL_INP_SHOW_DBMS_OUT`</td><td>No</td><td>Check to print DBMS output in the log.</td></tr></tbody></table>

# Artifacts

This operation consumes packages of files created by the [packageBuild(SQLcl)](https://docs.flexagon.com/flexdeploy-9-0-documentation/flexdeploy-plugin-guides/flexdeploy-sqlcl-plugin-guide/packagebuild-sqlcl.md) operation.

# Endpoint Selection

This operation delegates the selection to the workflow developer to determine.

# Endpoint Execution

This operation will randomly execute on one of the endpoints identified during selection.

# Special Considerations

## login.sql

The script provided in the input `FDSQLCL_INP_LOGIN_SQL_FILE` will be created as the login.sql file in the current working directory and will be deleted after execution. The login.sql script in SQLcl is automatically executed whenever you start SQLcl. It can be used to set up your SQLcl environment, including formatting options, environment variables, and other session settings.

Below is an example script that can be customized based on requirements.

```
-- Set the SQLcl environment settings
SET ECHO OFF
SET FEEDBACK ON
SET HEADING ON
SET LINESIZE 200
SET PAGESIZE 9999
SET SERVEROUTPUT ON
SET TERMOUT ON
SET TIMING ON
SET VERIFY OFF

-- Set default schema
ALTER SESSION SET CURRENT_SCHEMA=YOUR_SCHEMA_NAME;

-- Define common substitution variables
DEFINE my_variable = 'default_value'

-- Custom SQL*Plus prompt
SET SQLPROMPT "SQL> "

-- Display a welcome message
PROMPT Welcome to SQL*Plus
```

Please see below for information about the project file attributes

# Supported Object Types

The SQLcl plugin partial deploy support allows for deploying File and Folder type objects. These links explain the three types and their attributes.

## Object Types

1. [DB Objects](https://docs.flexagon.com/flexdeploy-9-0-documentation/flexdeploy-plugin-guides/flexdeploy-sqlcl-plugin-guide/appendix-sqlcl/sqlcl-package-object-types/sqlcl-object-types-db-objects.md)

2. [Other Objects](https://docs.flexagon.com/flexdeploy-9-0-documentation/flexdeploy-plugin-guides/flexdeploy-sqlcl-plugin-guide/appendix-sqlcl/sqlcl-package-object-types/sqlcl-object-types-other-objects.md)
