IBM InfoSphere Streams Version 4.1.1

Operator error output port

Many operators in the Database Toolkit provide the capability to specify an optional output port. The output port contains information about errors that occur at run time. You can use this port to handle errors as they occur in an application.

Tuples are generated on this output port when certain runtime SQL error conditions occur.

This output port is non-mutating and its punctuation mode is Free.

The following list contains the attribute data types for operator error output ports. This output port can have up to four attributes, all of which are optional. The data types and contents of the attributes vary depending on the operator.
  • NetezzaPrepareLoad operator:
    • Attribute data types for the error output port:
      • Integer (int32): Not applicable.
      • String (rstring): Not applicable.
      • Tuple: This operator supports an attribute that is an embedded tuple. The embedded tuple contains all of the attributes of the input tuple that pertains to the SQL error.
  • ODBCAppend, ODBCEnrich, ODBCRun, and DB2PartitionedAppend operators:
    • Attribute data types for the error output port:
      • Integer (int32): These operators support an integer attribute that contains the SQL return code.
      • String (rstring): You can specify up to two raw string attributes. The first string attribute contains the SQL message data. The second string attribute (if specified) contains the SQL state.
      • Tuple: These operators support an attribute that is an embedded tuple. The embedded tuple contains all of the attributes of the input tuple that pertains to the SQL error.
  • ODBCSource operator:
    • Attribute data types for the error output port:
      • Integer (int32): The operator supports an integer attribute that contains the SQL return code.
      • String (rstring): You can specify up to two raw string attributes. The first string attribute contains the SQL message data. The second string attribute (if specified) contains the SQL state.
      • Tuple: Not applicable.
  • NetezzaLoad operator:
    • Attribute data types for the error output port:
      • Integer (int32): The operator supports an integer attribute that contains the SQL return code.
      • String (rstring): You can specify up to three raw string attributes. The first string attribute contains contains a delimited string that is taken from the file with the error. The second string attribute (if specified) contains the SQL message data. The third string attribute (if specified) contains the SQL state.
      • Tuple: Not applicable.

Examples

The following example shows an ODBCAppend operator invocation, which uses a configured error output port:

stream <tuple<PersonSchema> inTuple, int32 sqlcode, rstring sqlmessage,
	rstring sqlstate> errors = ODBCAppend ( MyInputDataStream )
{
param 
	connectionDocument : "connections.xml";
	connection         : "PersonDB"; 
	access             : "PersonSink";
}        

The following example shows an ODBCSource operator invocation, which uses a configured error output port. The operator has two output ports. The first port is the port that contains the generated source data tuples for the operator. The ODBCSource operator has no input port, so the error output port does not contain the embedded input tuple.

(stream <int32 id, rstring fname, rstring lname>;
stream <int32 sqlcode, rstring sqlmessage, rstring sqlstate> errors) =
ODBCSource ()
{     
	param
		connectionDocument : "connections.xml";
		connection         : "PersonDB";
		access             : "InfPeronIFL"; 
		initDelay          : 3.0; 
}