ExportFieldToColumn

A page-level action that extracts the captured value of a Field object from the Data file of the current page, and specifies its target location within a table of the Export database.

Syntax

bool ExportFieldToColumn (strParam)

Parameters

Three comma-separated values:
  1. The name of the field whose value will be stored in the column.
  2. The name of the database column that will hold the value.
  3. Optional: Can be set to the numerical value of 1, 2, or 3.

If this parameter is not specified, quotes will be placed around the value in the SQL query to update the table.

Setting the value to 1 causes this action to return False if the Table name is invalid; otherwise the error will not be discovered until the action that performs the DB insert call, such as an AddRecord action, is called. This value would typically only be used in a development environment as it will increase processing time.

Setting this value to 2 allows NULL column values and inserts no quotes around values (for numeric) in the SQL query to update the database.

Setting the value to 3 allows NULL and if the column value is not NULL, the column value will be surrounded in quotes in the SQL query to update the database.

Returns

False if:
  1. There is no connection to the database.
  2. The database column specified as a parameter does not exist.
  3. The Field object identified by the parameter does not exist.
  4. A SetTableName action was not used previously.

Otherwise, True.

Level

Page level only.

Details

This is a page-level action that extracts the captured value of a Field object from the Data file of the current page, and specifies its target location within a table of the Export database.

Within a rule, this action should run before an AddRecord action, which commits the data to the database.

Example:
SetTableName("Export_Results")
ExportFieldToColumn("VendorID,db_Number,2")
ExportFieldToColumn("Date,db_Date")
ExportFieldToColumn("Total,db_Total")
AddRecord() 
This action exports the captured value of three Field objects from the Data file of the current page, to corresponding columns of the Export_Results table, within the open Export database. It also provides the action with an optional Style value.
Important: Make sure you use the ExportOpenConnection action to establish a connection to your Export database. This is usually accomplished by a rule at the Batch level.