Here are some considerations for SQL File format and deployment.
SQL File Format
Program blocks should be terminated by use of /. See examples below. For example, Package Specification, Package Body, Trigger etc. FlexDeploy will add / at the end of the file is last statement is program block.
EXECUTE IMMEDIATE 'DROP TABLE XXHR.XXHR_WF1';
WHEN OTHERS THEN
EXECUTE IMMEDIATE 'DROP SYNONYM XXHR_WF1';
WHEN OTHERS THEN
CREATE OR REPLACE PACKAGE xxhr_bipub_rep_pkg AS
PROCEDURE generate_xml(p_errbuf OUT VARCHAR2
,p_retcode OUT NUMBER);
Non program blocks
Statements that are not program blocks should be terminated using ;. For example create or replace view, insert etc.
CREATE SYNONYM apps.XXHR_WF1 FOR xxhr.XXHR_WF1;
CREATE OR REPLACE FORCE VIEW "APPS"."DUMMY_V1" ("COUNT") AS
(SELECT 1 from dual);
Comments in SQL file. See below for supported formats.
--single line comment
* Name : XXHR_WF1 *
Following comment is not supported as it will cause SP2-0103: Nothing in SQL buffer to run.
/*Added comment by chandresh to test flexdeploy*/
Consider adding compileInvalidSqls operation in Deploy workflow if SQL files are being deployed. This operation can take longer if there are many invalid objects in Schema.
Custom objects in non apps schema
Custom objects in non APPS schema with grants to APPS user. It is recommended by Oracle to create custom objects in custom schema. You need to provide Grants to APPS user to these custom objects. You can achieve this in two different ways in FlexDeploy.
- Give necessary rights to APPS user, so it can select on any other schema objects. For example, SELECT ANY TABLE privilege can be given to APPS and similarly other ANY type Grants can be given to APPS user.
- Use custom schema user in FlexDeploy to create objects and grant to APPS.
- Create custom user and password properties on Deploy workflow to be at Environment Instance Scope. For example,
- Defined values for these user and password in various Environment Instance pages in Topology.
- Use custom properties on Project Files tab for specific Files.
- If you want the file to populate with the correct schema user and password property attached, create the filename like "SCHEMASCHEMANAME_FILENAME.sql"
- e.g. SCHEMAPOS_registertrans.tbl
- This will automatically try to use the properties FDEBS_DB_SCHEMAPOS_USER and FDEBS_DB_SCHEMAPOS_PASSWORD, so if using the filenames to link the schema users, follow this naming standard of the property codes.