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

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

Inheritance diagram for OMQ::QorusRawSqlStatementOutboundMapper:
TableMapper::RawSqlStatementOutboundMapper TableMapper::AbstractSqlStatementOutboundMapper Mapper::Mapper

Public Member Methods

 constructor (hash mapv, *hash opts)
 constructs a mapper object More...
 
hash optionKeys ()
 returns a list of valid constructor options for this class (can be overridden in subclasses) More...
 

Static Public Member Methods

static Qore::SQL::AbstractDatasource getDatasource (reference opts)
 called in the constructor to get the Table object
 

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")
# END

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 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

Member Function Documentation

◆ constructor()

OMQ::QorusRawSqlStatementOutboundMapper::constructor ( hash  mapv,
*hash  opts 
)

constructs a mapper object

Parameters
mapva mapping hash
optsa option hash

◆ optionKeys()

hash OMQ::QorusRawSqlStatementOutboundMapper::optionKeys ( )

returns a list of valid constructor options for this class (can be overridden in subclasses)

Returns
a list of valid constructor options for this class (can be overridden in subclasses)

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