Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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. 

Code Block
languagesql
themeRDark
titleFor example
ALTER SESSION SET current_schema=${{MYINST:MYSCHEMA}} 

...

Sample SQL script file

Code Block
languagesql
themeRDark
linenumberstrue
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;

...