Stored Procedures and Open SQL
PostgreSQL user-defined functions written in PL/pgSQL or SQL languages can be invoked with
RWDBOSql using
SELECT syntax.
RWDBOSql myOpenSqlObject("SELECT * FROM myStoredFunc($1, $2);", RWDBOSql::Procedure);
In this example, myStoredFunc is the name of the stored function, and $1 and $2 are placeholders for the parameters to be passed to the function. Note the hint provided as RWDBOSql::Procedure. The return value, if any, is returned as a result set.
Please see
“Open SQL Stored Procedure Examples” for an example that uses
RWDBOSql with stored procedures.
Out Parameters and Return Values
The DB Access Module for PostgreSQL does not currently support stored functions with OUT parameters. The return value from a stored function is received in the form of a result set. The function fetchReturnParams() is a no-op for this access module. However, to make your application portable across different access modules, it is recommended to call fetchReturnParams(), after completely processing the result sets.