Versions Compared

Key

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

XML files containing one or more data fix sql statements, a sql statement to back up data, and validation statements used to determine whether the data fix should be committed or rolled back.

Object Type Identification

...

NameCodeDescriptionDefault Value
Data Fix Root Source DirectoryFDEBS_DATA_FIX_ROOT_SOURCE_DIRThe source directory to recognize files as data fixesdatafix
Data Fix Root Destination DirectoryFDEBS_DATA_FIX_DESTINATION_DIRThe destination directory to copy file to.  Leave blank to not copy file anywhere

Related Environment Instance Properties

NameCodeRequiredDescription
JDBC Driver PathFDEBS_DRIVER_PATHYesLocation of JDBC driver file required only for running data fix files. For example, /u01/app/oracle/product/12.1.0/dbhome_1/jdbc/lib/ojdbc6.jar

Sample Build Commands 

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

...

ElementPathXSD Line NumberDescription
DataFix/3The root element for the data fix
Description/DataFix9A description for the data fix being run
FixSQL/DataFix10The SQL which implements the data fix. It can be multiple statements delimited by a semicolon or slash
BackupSQL/DataFix11

SQL to perform necessary backup of data before executing FixSQL. This must  This can be one valid SQL statement, not followed or more statements delimited by a semicolon or slash

Tip

Include ${{FD_PROJECT_VERSION}} in the title of your backup table to easily identify it after execution


ConnectStringProperty/DataFix12The JDBC connection string for the database. The APPS_JDBC_URL environment variable will be used if not specified in file
UserProperty/DataFix13User to connect to database with. The object attribute will be used if property is not specified in file
PasswordProperty/DataFix14Password for the database user. The object attribute will be used if property is not specified in file
Validations/DataFix15The rule(s) used to validate the data fix before committing changes
Validation/DataFix/Validations18A single validation rule
Description/DataFix/Validations/Validation21A description for the validation rule
ValidationSQL/DataFix/Validations/Validation22Select query which is executed before and after the FixSQL is executed, and result is compared with before and after values. This must be one valid SQL statement, not followed by a semicolon
Environment/DataFix/Validations/Validation23The expected results defined by an environment
EnvironmentCode/DataFix/Validations/Validation/Environment26FlexDeploy environment code, or DEFAULT to apply to any deploy environment not explicitly specified
Before/DataFix/Validations/Validation/Environment27Contains results to check before FixSQL is executed
After/DataFix/Validations/Validation/Environment28Contains results to check after FixSQL is executed
UpdateCount/DataFix/Validations/Validation/Environment29Results to compare return of JDBC executeUpdate() of FixSQL. If the FixSQL contains more than one statement, it is the sum of the updated rows
OperatorsN/A42Complex type containing list of accepted operators to be used in validations

...

Code Block
languagexml
themeRDark
titleLine Item Fix
<?xml version="1.0" encoding="UTF-8"?>
<DataFix xmlns="http://flexagon.com/database/datafix">
    <Description>Fix line items for product IDs 47809 and 45203</Description>
    <FixSQL>update XXHR.xxhr_order_items set unit_price = 100 where product_id = 47809;
            update XXHR.xxhr_order_items set unit_price = 75 where product_id = 45203;</FixSQL>
    <BackupSQL>create table xxhr
			update XXHR.xxhr_orderproduct_items_bkplist as (select * from xxhr.xxhr_order_items)</BackupSQL>set list_price = 100 where product_id = 47809;
     <Validations>       update  <Validation>
     XXHR.xxhr_product_list set list_price = 75 where product_id = 45203;</FixSQL>
    <BackupSQL>create table xxhr.xxhr_order_items_bkp as (select * from xxhr.xxhr_order_items)</BackupSQL>
    <Validations>
        <Validation>
            <Description>Verify number of rows modified for product with id 47809</Description> number of rows modified for product with id 47809</Description>
            <ValidationSQL>select count(*) from xxhr.xxhr_order_items where list_price = 100 and product_id = 47809</ValidationSQL>
            <Environment>
                <EnvironmentCode>DEV</EnvironmentCode>
                <UpdateCount>
                    <GreaterThan>80</GreaterThan>
                    <LessThan>100</LessThan>
                </UpdateCount>
 <ValidationSQL>select count(*) from xxhr.xxhr_order_items where list_price = 100 and product_id = 47809<</ValidationSQL>Environment>
            <Environment>
                <EnvironmentCode>DEV<<EnvironmentCode>default</EnvironmentCode>
                <UpdateCount>
                    <GreaterThan>80<<GreaterThan>87</GreaterThan>
                    <LessThan>100<<LessThan>93</LessThan>
                </UpdateCount>
            </Environment>
        </Validation>
        <Validation>
            <Description>Verify number <Environment>of rows modified for product with id 45203</Description>
         <EnvironmentCode>default</EnvironmentCode>   <ValidationSQL>select count(*) from xxhr.xxhr_order_items where list_price = 75 and product_id = 45203</ValidationSQL>
  <UpdateCount>          <Environment>
          <GreaterThan>87</GreaterThan>      <EnvironmentCode>default</EnvironmentCode>
              <LessThan>93</LessThan>  <UpdateCount>
              </UpdateCount>      <GreaterThan>120</GreaterThan>
      </Environment>         </Validation>     <LessThan>125</LessThan>
   <Validation>             <Description>Verify</UpdateCount>
number of rows modified for product with id 45203</Description>    </Environment>
        <ValidationSQL>select count(*) from xxhr.xxhr_order_items where list_price = 75 and product_id = 45203</ValidationSQL>
       </Validation>
		<Validation>
            <Description>Verify total number of row updates</Description>
    <Environment>        <ValidationSQL></ValidationSQL>
        <EnvironmentCode>default</EnvironmentCode>    <Environment>
            <UpdateCount>    <EnvironmentCode>default</EnvironmentCode>
                <GreaterThan>120</GreaterThan><UpdateCount>
                    <LessThan>125<<Equals>4</LessThan>Equals>
                </UpdateCount>
            </Environment>
        </Validation>
    </Validations>
</DataFix>

...