User guide
Data Integration with Sybase Avaki Studio 73
The expressions menu
Avaki Functions
The Avaki Functions submenu provides utility functions that you can use in your
expressions. It contains several functions you can use to retrieve values from result
sets as well as functions to add logic about who the current user is.
Result set accessors
The utility functions in the Avaki Functions submenu that operate on result sets auto-
matically deal with the case where the column value is null. Each function takes two
parameters:
• resultSet: the ResultSet object from which you want to extract the data, and
Bitwise XOR (^) Produces a new value whose bits are set when only one (but not
both) of the corresponding bits in the
LHS and RHS is set.
0xf0a6 ^ 0xcd0f evaluates to 0x3da9, for example.
Bitwise NOT (
~) Produces a new value whose bits are inverted with respect to the
RHS. Note that there is a “unary” operator—there is no LHS.
~0xcd0f evaluates to 0x32f0, for example.
Shift left (
<<) Produces a new value by shifting the bits of the LHS n positions
to the left, where n is the value of the
RHS. The new rightmost
bits will be 0s.
0xcd0f << 1 evaluates to 0x19a1e, for exam-
ple.
Shift right (
>>) Produces a new value by shifting the bits of the LHS n positions
to the right, where n is the value of the
RHS. The new leftmost
bits will be 0s.
0xcd0f >> 1 evaluates to 0x6687, for example.
Modulus (
%) Returns the remainder you would have if you had performed a
division of
LHS by RHS. 8%5 evaluates to 3, for example (8
divided by 5 is 1 with the remainder 3).
In-line conditional (
?:)Used in the form cond ? expr1 : expr2 where cond is an
expression that evaluates to a Boolean value. Evaluates to
expr1
if
cond is true, or expr2 if cond is false. For example, the
expression
x > 5 ? 2 : 1 evaluates to 2 when x is greater than
5 and evaluates to 1 when x is not greater than 5.
This is sometimes referred to as a ternary conditional, since it has
three operands.
Menu Item Description