Define a mobile business object (MBO) from a stored procedure's Scalar and Cursor output parameters (and Cursor result sets).
Scalar parameters are common to all databases and Cursor parameters are exclusive to Oracle and DB2 databases.
There is a limitation for attributes mapped to Scalar parameters of ASA and DB2 Native stored procedures. The length of attribute cannot be obtained, and is set to 10. You can manually change the attribute length in the Properties view or use an OLE or ODBC connection instead of the Native connection; both obtain the correct Scalar attribute length.
From a stored procedure, the developer can map attributes of a MBO to:
Stored procedure's output parameter | SQL query/definition |
---|---|
Scalar output parameter (ASA) |
{CALL testScalarSPOP(@OP["id"=""],@OP ["amount"=""])} create PROCEDURE dba.testScalarSPOP (in id INT, out amount INT) BEGIN select * from bonus; select bonus_amount into amount from bonus where emp_id = id; END |
Cursor as output parameter (Oracle) |
{CALL TESTCURSORSPOP(@OP["pcursor"=""])} create or replace procedure testCursorSPOP( p_cursor out types.cursorType ) as begin open p_cursor for select * from tblSPOP; end; |
Cursor as return result set (DB2) |
{CALL TESTCURSORSPOP()} CREATE PROCEDURE testCursorSPOP() LANGUAGE SQL DYNAMIC RESULT SETS 1 BEGIN DECLARE C1 CURSOR WITH RETURN TO CLIENT FOR SELECT * FROM tblSPOP; OPEN C1; END |
Only In and Inout parameters appear in the Preview dialog. Out parameters are filtered from the parameter table.
When the mouse hovers over an optional result set in the Select a result set to preview field, a tooltip describes the column structure of the result set.
All Scalar output parameters are grouped into a single result set (DERIVED in the Select a result set to preview field) while each Cursor output parameter derives a separate result set.
Similar to the Preview dialog, in that when the mouse hovers over the result set in the Select a result set to preview field, a tooltip describes the column structure. All possible result sets are listed in the corresponding input field (DERIVED and RESULT SET -n), from which you can select one for attribute mapping.
Whenever you change the result set, the mapping control and mapping table are automatically refreshed.