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 7 Next »

In both cases, after successful packaging job, scripts move into “archive” folder.


Scripts in “DDL”:

Each script in “ddl” directory go through a process during packaging called “convert SQL”. The output of the “convert SQL” is XML changeset that defines EVERY change of the object derived from a script. The benefit of “convert SQL” is that Datical can forecast these changes during forecast operation. Here is what a “convert SQL” generated changeset would look like. Notice that we identify creation of the table along with each column in the table.


changelog.xml (ddl)
    <changeSet appdba:scriptChecksum="10465378bdaf34aa6c432f0971dff485" author="jenkins (generated)" context="REF1, DEV, TEST, PROD" created="2018-07-02 14:34+0000" datical:origFileName="createAAA_TESTA1_new.sql" datical:origFilePath="ddl/NGT" datical:version="1" datical:versionStrategy="DEPLOY_ALL" id="7opf-1 (createTable tableName=AAA_TESTA1)" labels="sid-9090, 22, ddl, createaaa_testa1_new.sql" objectQuotingStrategy="QUOTE_ALL_OBJECTS">
        <createTable schemaName="NGT" tableName="AAA_TESTA1">
            <column name="ID" type="NUMBER(*, 0)"/>
            <column name="FIRST_NAME" type="VARCHAR2(50 BYTE)"/>
            <column name="MIDDLE_NAME" type="VARCHAR2(50 BYTE)"/>
            <column name="LAST_NAME" type="VARCHAR2(50 BYTE)"/>
            <appdba:storageOptions dbms="oracle" path="ngt/storage/AAA_TESTA1_tbl_1530542040659.sql"/>
        </createTable>
    </changeSet>


Scripts in “SQL_DIRECT”:

On the other hand, scripts in “sql_direct” receive a very different treatment. Datical does not perform “convert SQL” operation on these scripts and as such the XML changeset simply references the SQL script instead of exact changes to the database. The downside here is that Datical is unable to forecast changes from scripts in “sql_direct” folder. Here is what a “sql_direct” generated changeset would look like. Notice that XML simply references the script (see 'path="sql/2018080814545272_createAAA_TESTA6.sql" ') which is available to the changelog.xml via “resources” folder of the Datical project.


changelog.xml (sql_direct)
    <changeSet appdba:scriptChecksum="50be173164ac75b6500a2ff963636a67" author="Adeel Malik" context="REF1, DEV, TEST, PROD" created="2018-08-08 14:54+0000" datical:origFileName="createAAA_TESTA6.sql" datical:origFilePath="sql_direct/NGT" datical:version="1" datical:versionStrategy="DEPLOY_ALL" id="2018080814545272_createAAA_TESTA6" labels="58,$all,createAAA_TESTA6.sql">
        <appdba:sqlplus enableRollbackOnError="true" path="sql/2018080814545272_createAAA_TESTA6.sql" removeSpools="First" schemaName="NGT"/>
        <comment>script6</comment>
    </changeSet>


Related topics:

How To: Choose Between CONVERT (ddl) and DIRECT (sql_direct) Packaging Methods

Writing SQL Scripts for Datical DB

Overview of Packaging

Fixed Folder Names#ProcessingChanges

https://datical-cs.atlassian.net/wiki/spaces/DDOC/pages/896569975/Flexible+Folder+Names#FlexibleFolderNames-ComplexandInterdependentDatabaseChanges


  • No labels