Examples of using database schema in the Database Outbound protocol

In the Database Outbound protocol, database schema is used to parse the Cloverleaf message into column values. Then, the column values can be used to replace the placeholders set in the SQL statement/stored procedure.

These examples show how the Database Outbound protocol passes a Cloverleaf message that is based on database schema.

The Table_sanity database schema includes visible columns for ID, strFLD, intFLD, date FLD, and flag.

Example 1: The outbound message field count is the same as the visible column count of database schema

Outbound message:

key01,test1,1,10/01/12,1

Database schema columns:

ID, strFLD, intFLD, dateFLD, flag

Parsing results

ID: key01
strFLD: test1
intFLD: 1
dateFLD: 10/01/12
flag: 1

If placeholder tableName.columnName is set in the SQL statement/stored procedure, the parsed column value replaces the corresponding placeholder in the SQL statement/stored procedure.

Example 2: The outbound message field count is less than the visible column count of database schema

Outbound message:

key01,test1, ,10/01/12

Database schema columns:

ID, strFLD, intFLD, dateFLD, flag

Parsing results:

ID: key01
strFLD: test1
intFLD: 
dateFLD: 10/01/12
flag: 

There are only four fields in the outbound message. No message field matches the flag database schema column, so the flag column has an empty value. The third field of the outbound message is empty, so the intFLD column also has an empty value.

Example 3: The outbound message field count is greater than the visible column count of database schema

Outbound message:

key01,test1,1,10/01/12,1,fakevalue

Database schema columns:

ID, strFLD, intFLD, dateFLD, flag

Parsing results:

ID: key01
strFLD: test1
intFLD: 1
dateFLD: 10/01/12
flag: 1

If the outbound message field count is greater than the column count of database schema, the extra fields in the outbound message are ignored.