User`s guide
Customizing SQL and transformation rules
56 Sybase IQ ETL 4.1
SELECT * FROM CUSTOMERS WHERE CU_NO = '12345678'
With SBN you can use a more flexible approach by assigning the constant
value of CU_NO to a component variable. Assuming that value ‘12345678’
was assigned to CustNo, the SELECT statement with the dynamic expression
would look like the following example:
SELECT * FROM CUSTOMERS WHERE CU_NO = '[REF.CustNo]'
You can use any of the Sybase IQ ETL functions inside the SBN. The following
statement returns the same record using a value of “1234” for CustNo1 and a
value of “4567” for CustNo2:
SELECT * FROM CUSTOMERS WHERE CU_NO = '[uConcat
(REF.CustNo1, REFCustNo2)'
Manipulating the TRACE level at the start of a query
To manipulate the TRACE level at the start of a query, SELECT * FROM
PRODUCT [uTracelevel(5)]
.
The function
uTracelevel() returns no value; therefore, the SBN expression
[uTracelevel(5)] can coexist with the SQL statement. After the SBN expression
has been evaluated, the SQL statement to execute will be:
SELECT * FROM PRODUCT
You can even execute the following query:
[uTracelevel(0)]
Pre-processing and post-processing SQL
For any component with database connectivity you can enter pre-processing
and post-processing SQL statements in the Property section. Those properties
allow entering SQL statements that are executed during initialization (pre-
processing) or after completion (post-processing) of the component.
Some considerations are:
• The SQL statements will not return output after being executed.
• Any SQL statement accepted by the connected database system is
allowed.
• You can enter multiple SQL statement in the pre-processing or post-
processing SQL property by using a semicolon; as a statement delimiter.
• SBN expressions are allowed in pre-processing and post-processing SQL.