Creating Transactions Section of Data File

About Creating the Transactions Section of the Data File

The Transactions section of the data file specifies the type of action to execute on the data. It consists of one or more transaction formats. A given transaction format can also be called a transaction block. You can include one or more transactions in a data file. For more information and examples on the available transaction formats, see About Transaction Types.  You need to specify the Dbname for a Class, Property, and Pointer in the Transactions section. The topics covered in this section are:

This task explains how to get the DBnames for a particular transaction:
  1. Log on to the CES Administration Desktop.

  2. From the navigation pad, select Power Search.

  3. Search for class properties.

  4. Select Class properties.

  5. Click Go to Search.

  6. Search for the required property label.

    Class property DB Name is obtained in the Power Search View.

Transaction section example

This example shows a Transaction section of a data file:

In the above example, the insertRandom keyword indicates the kind of action that should be executed on the data. The information following this keyword specifies the name of the class in which the new object will be inserted. It also indicates the values that should be inserted for the specific fields. For insert, update, and delete tasks, you must include the primary key fields.

Syntax Reference

This table describes the basic keywords, variables, and symbols that you can use in the transaction formats:

Item Explanation

class

Specifies the class of the object that is being pointed to. Provide the associated database column name.

class-name

Indicates the database table name for the class to which the given object(s) belongs.

field

Indicates a class property name. Provide the name of the associated column in the database.

key

Indicates the beginning of a key or a primary key statement. The primary key statement specifies the primary keys of the object you want to select. It provides a search criterion for finding the object in question.
This statement is required in all update, move, and delete transactions. Provide the name of the associated column in the database.
The key statement indicates keys other than the primary keys for selecting multiple objects for export.
When specifying primary key values in a primary key statement, you might not know all the primary key values. CES will try to search for the object with the given primary key values. If you give a partial primary key, the tool attempts to use that key to match a single object. The tool generates an error if it does not find a record or it finds more than one matching record.

objectPtr

Indicates the beginning of an object pointer statement. The object pointer statement specifies the primary keys and the owner class of a pointer. If the pointer is mapped to a template object, which is different from having a template mapped to an object, you must supply the template key as the primary key.

objectPtr pointer-name {
class=class-name
}

To set an object pointer to null, leave the braces between the braces in the objectPtr statement empty, as shown in this example:
objectPtr e_res_sup_ptr {}

pointer-name

Indicates the corresponding database table name for a pointer.

fd

Indicates the field delimiter character defined in the options section of the data file or in the command-line options.

str

Indicates a character string specifying a data value. To use the quotation mark within a quoted string, put a backslash (\) in front of the quotation mark, and the parser will not read it as the end of the string.

Treating Several Transactions as Single Transaction
You can treat several DBLoad transactions as single transaction using the beginTransaction and endTransaction commands. Use these commands to ensure that no transaction gets committed to the database if any of the instructions in the transaction block fails.

Command Usage

  • Enter beginTransaction at the beginning of a series of transactions.

  • Enter endTransaction at the end of a series of transactions.

Guidelines

  • Do not nest the commands.

  • Do not provide an endTransaction command without a beginTransaction command preceding it.

  • Do not include options statement between beginTransaction and endTransaction.

  • Always complete the transaction block with a beginTransaction and endTransaction command.

Results

  • Commits all previous transactions when the tool encounters a beginTransaction command.

  • Does not issue any commit or rollback until the tool encounters the endTransaction command.

  • Commits all transactions processed until an endTransaction command.

  • Rolls back all previous transactions between a beginTransaction and endTransaction block, if any transaction fails to execute in the middle of the beginTransaction and endTransaction command.

Case Sensitivity

Keywords and most names in a specific format are not case sensitive. Only CES Database names are case sensitive.

Note: You may need to use escape characters if the value has double quotes (") or backslash (\) in the value field.
For example, if the value is XYZ\ or XY\Z, then after using the escape characters, the value should become XYZ\\ and XY\\Z respectively.