Qorus Integration Engine®  4.1.4.p4_git
OMQ::QorusSqlStatementOutboundMapper Class Reference

Qorus oubound mapper based on SqlUtil select. More...

Inherits SqlStatementOutboundMapper.

Public Attributes

const OptionKeys
 valid mapper keys
 

Detailed Description

Qorus oubound mapper based on SqlUtil select.

Options used for QorusSqlStatementOutboundMapper are:

Example of the mapper definition in the qmapper file:

# name: regression-out-sql-statement
# version: 1.0
# desc: Regression test for QorusSqlStatementOutboundMapper
# type: QorusSqlStatementOutboundMapper
# author: Petr Vanek (Qore Technologies, s.r.o.)
OPTION: datasource: "omquser"
OPTION: table: "regression_example"
OPTION: sh: {
"columns": "uuid",
"where": {
"in_transit": M_BIND,
"qorus_wfiid": {
"^bind^":"parent_wfiid"
},
},
}
OPTION: output: (
)
FIELD: "uuid_mapped": "uuid"
FIELD: "some_const": ("constant" : "foobar")
# END

QorusSqlStatementOutboundMapper Variable Binding

When QorusSqlStatementOutboundMapper is initialized it can get the bind runtime option to make sh parametrized at runtime.

Example of mapper initialization in the workflow step:

hash<auto> ropts = {
"bind": {
"in_transit": 5,
"parent_wfiid": 1000,
},
};
QorusSqlStatementOutboundMapper m = getMapper("regression-out-sql-statement", ropts);

Then values provided in runtime options (ropts), key "bind" are passed to the mappers's select hash.

You can se use of the so called variable binding in the example above.

  • OMQ::M_BIND is a helper constant which says to the runtime that bound hash will contain the same key as the where condition hash key.
  • {"^bind^": string} says that where condition hash key will be bound by the value of string in the binding hash

The documentation for this class was generated from the following file: