Qorus Integration Engine®  4.1.4_git
OMQ::QorusRawSqlStatementOutboundMapper Class Reference

Qorus oubound mapper based on raw SQL select statement. More...

Inherits RawSqlStatementOutboundMapper.

Public Attributes

const OptionKeys
 valid mapper keys

Detailed Description

Qorus oubound mapper based on raw SQL select statement.

Options used for SqlRawStatementOutboundMapper are:

Example of the mapper definition in the qmapper file:

# name: regression-out-sql-statement
# version: 1.0
# desc: Regression test for QorusSqlStatementOutboundMapper
# type: QorusRawSqlStatementOutboundMapper
# author: Petr Vanek (Qore Technologies, s.r.o.)
OPTION: datasource: "omquser"
OPTION: select: "select * from my_table where id = %v"
OPTION: output: ()
FIELD: "uuid_mapped" : "uuid"
FIELD: "some_const" : ("constant" : "foobar")

SqlRawStatementOutboundMapper Variable Binding

When SqlRawStatementOutboundMapper 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": 1};
SqlRawStatementOutboundMapper m = get_mapper("regression-out-sql-statement", ropts);

Then values provided in runtime options (ropts), key "bind" are passed to the mappers's select statement. Resulting in for example:

select * from my_table where id = :var_1;
-- binding 1 into :var_1

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