> ## 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.

# Appendix-SQLcl

> Replacement Properties The SQL files are pre processed by the plugin to transform any defined . An example usage of replacement properties is when the

## Replacement Properties

The SQL files are pre-processed by the plugin to transform any defined [replacement properties](https://flexagon.atlassian.net/wiki/spaces/FD10/pages/11845810449/Property+Replacement+Support).  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. 

##### **For example, you could add one line to the beginning of your sql files**

```
ALTER SESSION SET current_schema=${{MYINST:MYSCHEMA}} 
```

Where `MYSCHEMA` is a Target property for the `MYINST` instance.  To achieve this you would create a Target-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;
```

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-10-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-10-0-documentation/flexdeploy-plugin-guides/flexdeploy-sqlcl-plugin-guide/appendix-sqlcl/sqlcl-package-object-types/sqlcl-object-types-other-objects.md)
