User guide
Data Integration with Sybase Avaki Studio 113
Custom
• To delete one or more columns, select them and click Delete.
• To reorder the columns, select one or more of them and click the Move Up or
Move Down buttons. (If you want to move multiple columns, the selection must be
contiguous.)
• You can edit the properties of each column. (See “Working with schemas” on
page 60 for information about the setting the name, type, precision, and scale of
columns.)
Name: Click in the a column’s name field to rename it.
Type: Specify the type of the column.
Precision: Specify the precision for the column, if applicable for the column’s
type.
Scale: Specify the scale for the column, if applicable for the column’s type.
Entering custom code
Enter and edit your custom code directly in the Custom Properties dialog. The code
you enter forms the body of the function that is called when your Custom operator is
asked for its next row of data. You can enter any JavaScript code here that would be
valid inside a function body. See “Using expressions within Avaki Studio” on page 66
for details on using JavaScript code within Studio.
Your code has access to the variables structure, including an object called
variables.<yourCustomOperatorName>, into which you can insert state vari-
ables, using expressions such as:
variables.myOperator.foo = 5;
In addition, you have access to all the incoming result sets from objects connected to
your operator. They are named <precedingOperatorName>RS (for example, if an
input source is named “CustomerInfo” there will be a variable named
CustomerInfoRS available to access it). Finally, you have access to the output
ResultSet object for your operator, which is named outputRS. This is actually a
subclass of java.sql.ResultSet on which you can only set values for the columns
in the current row. The runtime architecture takes care of incrementing the row each
time your operator is called.
If your code needs to call external functions or if you need to import other Java classes
in order to do your custom processing, you can add these to the .jsi file for your model.
For details, see “Using a .jsi file to enhance your model” on page 75.