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

« Previous Version 34 Next »

collection of reusable code, programs, and database objects that provides common functionality across all E-Business products.

Object Type Identification

  • Files ending in file extensions added to the EBS SQL Extensions (FDEBS_SQL_EXTENSIONS) project property are also added.
    • EBS SQL Extensions property defaults to seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc.

Files with .sql extension are identified as this type only AFTER excluding them as Concurrent Program SQLs (by source folder).

Files that start with "SCHEMA" will automatically update the user and password properties accordingly. See SQL File Considerations for more information.

File Extensions 

NameDescription
.seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prcA file containing sql statements. Extensions may be customized using the SQL Extensions project property.

Object Type

NameCode
DB Objects (SQLs)SQL

Object Type Attributes

NameCodeDescriptionDefault ValueSupported Values
SourceSOURCEObject Source Location Type

SCM

SCM
Target LocationTARGET_LOCATIONPath to where the file should be deployed to.$<PROD_TOP>/patch/115/sql/
TypeTYPEDB Object TypeGeneric SQL
DB User PropertyDB_USERFlexDeploy property to use as the user to connect to the database with.

FDEBS_DB_USER

You can use file name like SCHEMASCHEMANAME_FILENAME.sql. For example, SCHEMAPOS_registertrans.tbl. In this case this will default to FDEBS_DB_SCHEMAPOS_USER.


DB Password PropertyDB_PASSWORDFlexDeploy property to use as the password for the DB User Property.

FDEBS_DB_PASSWORD

You can use file name like SCHEMASCHEMANAME_FILENAME.sql. For example, SCHEMAPOS_registertrans.tbl. In this case this will default to FDEBS_DB_SCHEMAPOS_PASSWORD.


Ignore FailureIGNORE_FAILURE

Check if failure in file should be ignored.

If file contains WHENEVER SQLERROR CONTINUE case insensitively, this property will default to true.
Fix SQL SyntaxFIX_SQL_SYNTAX

If there is need to add / at the end of file, FlexDeploy will add it at deploy time. For example, if there is program block as last statement, we need / and new line after it.

True
Target File PermissionFILE_PERMISSIONSPermissions to apply to the file after it is deployedDefaults to the project property FDEBS_FILE_PERMISSIONS

Related Project Properties

NameCodeDescriptionDefault Value
SQL Root Source DirectoryFDEBS_SQL_ROOT_SOURCE_DIRSource folder for sql and pls files (e.g. db).sql
SQL Root Destination DirectoryFDEBS_SQL_ROOT_DESTINATION_DIRTarget directory for SQL and PLS files (e.g. XXHR_TOP/admin/sql).$<PROD_TOP>/patch/115/sql
SQL ExtensionsFDEBS_SQL_EXTENSIONSSQL file extensions in their order to process.

seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc

See Database SQL file extensions and their order of process.

SQL Ignore Compile ErrorsFDEBS_SQL_IGNORE_COMPILE_ERRORSIgnore SQL compilation errors for all files in the projectfalse
SQL Retry CountFDEBS_SQL_RETRY_COUNTRetry count for SQLs and PL/SQLs.5
File PermissionsFDEBS_FILE_PERMISSIONSTarget File Permission. Will be set to target file after deployment using chmod. eg: 755
Ignore Errors File ListFDEBS_IGNORE_ERRORS_FILE_LISTList of files to ignore errors (e.g. DropHRTables.sql,*_ddl.sql).

Sample Build Commands 

N/A - Build commands not supported for this type.

Sample Deploy Commands 

cp "$SOURCE_FILE" "$XXHR_TOP/patch/115/sql/";
cd "$XXHR_TOP/patch/115/sql/"
sqlplus $FDEBS_DB_USER/$FDEBS_DB_PASSWORD <<EOF
set define off
@XXHR_BIPUB_REP_PKG.seq
.
SHOW ERRORS
exit sql.sqlcode
EOF

Special Considerations

  • Make sure to end file with forward slash /, if last statement is FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER, TYPE, TYPE BODY.
    • FlexDeploy will automatically add / at the end of file if last statement is a program block.
  • Simple statements can be delimited by ; at end of statement but FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER, TYPE, TYPE BODY needs / after it no matter where it is added in SQL file.
    • FlexDeploy will automatically add / at the end of file if last statement is View, Insert, Update, Delete and does not end with ;.
  • Single or multiple line comments are also supported in input files.

Here are some considerations for SQL File format and deployment.

SQL File Format

Program blocks

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.

BEGIN
   EXECUTE IMMEDIATE 'DROP TABLE XXHR.XXHR_WF1';
EXCEPTION
   WHEN OTHERS THEN
      NULL;
END;
/

BEGIN
   EXECUTE IMMEDIATE 'DROP SYNONYM XXHR_WF1';
EXCEPTION
   WHEN OTHERS THEN
      NULL;
END;
/

CREATE OR REPLACE PACKAGE xxhr_bipub_rep_pkg AS

   PROCEDURE generate_xml(p_errbuf  OUT VARCHAR2
                         ,p_retcode OUT NUMBER);

END xxhr_bipub_rep_pkg;
/

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

Comments in SQL file. See below for supported formats.

Good comment examples
--single line comment
/* 
 * Name : XXHR_WF1                                                        *
 */

Following comment is not supported as it will cause SP2-0103: Nothing in SQL buffer to run.

Bad Comments
/*Added comment by chandresh to test flexdeploy*/

Recompiling invalids

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.

  1. 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.
  2. Use custom schema user in FlexDeploy to create objects and grant to APPS.
    1. Create custom user and password properties on Deploy workflow to be at Environment Instance Scope. For example,
    2. Defined values for these user and password in various Environment Instance pages in Topology.
    3. Use custom properties on Project Files tab for specific Files.
  3. If you want the file to populate with the correct schema user and password property attached, create the filename like "SCHEMASCHEMANAME_FILENAME.sql"
    1. e.g. SCHEMAPOS_registertrans.tbl
    2. 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.

Example File

DROP TABLE HR.DEPARTMENTS;

CREATE TABLE HR.DEPARTMENTS
(
     DEPARTMENT_ID NUMBER (4)  NOT NULL ,
     DEPARTMENT_NAME VARCHAR2 (30 BYTE)  NOT NULL ,
     MANAGER_ID NUMBER (6) ,
     LOCATION_ID NUMBER (4)
);

DROP SEQUENCE HR.DEPARTMENTS_SEQ;

CREATE SEQUENCE HR.DEPARTMENTS_SEQ
    INCREMENT BY 10
    MAXVALUE 9990
    MINVALUE 1
    NOCACHE;

CREATE OR REPLACE TRIGGER HR.ID_DEPARTMENTS
    BEFORE INSERT ON HR.DEPARTMENTS
    FOR EACH ROW
BEGIN
  SELECT HR.DEPARTMENTS_SEQ.NEXTVAL
  INTO   :new.DEPARTMENT_ID
  FROM   dual;
END ID_DEPARTMENTS;
/
  • No labels