IBM Integration Bus, Version 10.0.0.17 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS


cniSqlCreateStatement

Use this function to create an ESQL expression object that represents the statement specified by the statement argument, by using the syntax defined for the Compute node.

You cannot use the following statements:
  • CREATE PROCEDURE
  • CREATE MODULE
  • CREATE SCHEMA
  • CREATE FUNCTION
This function returns a pointer to the SQL expression object, which is used as input to the functions that execute the statement, which are cniSqlExecute and cniSqlSelect. You can create multiple SQL expression objects in a single message flow node. Although you can create these objects at any time, you would typically create them when the message flow node is instantiated, within the implementation function cniCreateNodeContext.

Syntax

CciSqlExpression* cniSqlCreateStatement(
  int*               returnCode,
  CciNode*           nodeObject,
  CciChar*           dataSourceName,
  CciSqlTransaction  transaction,
  CciChar*           statement);

Parameters

returnCode
The return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_NODE_OBJECT
  • CCI_INV_TRANSACTION_TYPE
  • CCI_INV_STATEMENT
nodeObject
The message flow processing node that the SQL expression object is owned by (input). This pointer is passed to the cniCreateNodeContext implementation function.
dataSourceName
The ODBC data source name used if the statement references data in an external database (input).
transaction
Specifies whether a database commit is performed after the statement is executed (input). Valid values are:
CCI_SQL_TRANSACTION_AUTO
Specifies that a database commit is performed at the completion of the message flow (that is, as a fully globally coordinated or partially globally coordinated transaction). This value is the default.
CCI_SQL_TRANSACTION_COMMIT
Specifies that a commit is performed after execution of the statement, and in the cniSqlExecute or cniSqlSelect function (that is, the message flow is partially integration node coordinated).
statement
The SQL expression to be created, using the syntax as defined for the Compute node (input).

Return values

If successful, the address of the SQL expression object is returned. If an error occurs, zero (CCI_NULL_ADDR) is returned, and the returnCode parameter indicates the reason for the error.


as08000_.htm | Last updated 2019-07-13 08:13:07