Column map procedures support most standard Lua functions. Column map procedures also support functions that are specific to Optim™.
A column map procedure can contain either a complex expression or a set of standard functions.
A complex expression is an unstructured block of statements. When a column map procedure contains a complex expression, the complex expression is called for every row processed. A complex expression is functionally the same as a cm_transform() function, but a complex expression cannot contain a formal function statement.
srcvalue = optim.source.getcolumnvalue()
if srcvalue = nil then
optim.target.setcolumnvalue('1')
else
optim.target.setcolumnvalue(srcvalue)
end
| Name | Description | Required |
|---|---|---|
| cm_load() | This function is called before any tables are processed. | No |
| cm_unload() | This function is called after all tables are processed. | No |
| cm_starttable() | This function is called at the start of processing for each table. | No |
| cm_endtable() | This function is called at the end of processing for each table. | No |
| cm_transform() | This function is called for every row processed. | Yes |
| Name | Description |
|---|---|
| optim.parms.num() | Get the number of parameters that are passed to the column map procedure. |
| optim.parms.get(n) | Get the value of the parameter at index n. |
| optim.print() | Print messages to process report. |
| Name | Description |
|---|---|
| optim.source.getdbalias() | Get the DB alias of the source data store. |
| optim.source.getcreatorid() | Get the creator ID of the source data store. |
| optim.target.getdbalias() | Get the DB alias of the target data store. |
| optim.target.getcreatorid() | Get the creator ID of the target data store. |
| Name | Description |
|---|---|
| optim.source.gettablename() | Get the name of the source table. |
| optim.target.gettablename() | Get the name of the target table. |
| Name | Description |
|---|---|
| optim.source.getcolumnvalue() | Get a value from the column whose name is entered as a
parameter. If no column is named, the function gets a value from the
source column. Use this function for nonnumeric columns and for numeric
columns that have data types other than the following data types:
A runtime error is generated if you use the optim.source.getcolumnvalue() function to get values from columns with binary data types. |
| optim.source.getcolumnasdouble() | Get a value in double-precision format from the column
whose name is entered as a parameter. If no column is named, the function
gets a value in double-precision format from the source column. Use
this function to get data from columns that have the following data
types:
|
| optim.source.getcolumnlength() | Get the length of the column whose name is entered as a parameter. If no column is named, the function gets the length of the source column. |
| optim.source.getcolumnname() | Get the name of the source column. |
| optim.source.getcolumntype() | Get the data type of the column whose name is entered as a parameter. If no column is named, the function gets the column type of the source column. |
| optim.target.setcolumnvalue() | Set the value of a target column. A runtime error is generated if you use the optim.target.setcolumnvalue() function to set values in columns with binary data types. The optim.target.setcolumnvalue() function can be used only within a complex expression or within the cm_transform function. |
| optim.target.getcolumnlength() | Get the length of the column whose name is entered as a parameter. If no column is named, the function gets the length of the target column. |
| optim.target.getcolumnname() | Get the name of the target column. |
| optim.target.getcolumntype() | Get the data type of the column whose name is entered as a parameter. If no column is named, the function gets the data type from the target column. |
| optim.target.iscolumnnullable() | Determine whether the column whose name is entered as a parameter is nullable. If no column is named, the function determines whether the target value is nullable. The function returns true if the column is nullable and returns false if the column is not nullable. |
| optim.mask() | Call an Optim Data Privacy Providers (ODPP) provider. Each call contains the value to be masked, the provider to use to mask the value, and the parameters that determine how the provider masks the value. Use the information in the Optim data privacy provider library to determine which parameters are to be used in the call. The following example shows a valid
call to mask the email address username@example.com by
using the email provider.
The optim.mask() function can be used only within a complex expression or within the cm_transform function. |
| optim.rejectrow() | Skip row and go to the next row. The optim.rejectrow() function can be used only within a complex expression or within the cm_transform function. |