Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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. 

For example
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 PL/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;  -- NOTE: semi-colon here is required to compile
/
grant execute on emp_mgmt to HR  -- NOTE: no semi-colon here
/
grant execute on dept_mgmt to HR  -- NOTE: no semi-colon here
/
  • No labels