Database stored procedures

Table 183. 

SQL statements


The following statements are supported:


    DECLARE lproc_1 PROCEDURE FOR StoreProcedure ​@f1 = :p1 IN, @f2 = :p2 OUT, ... @fn = :pn USING trans_obj;

    EXECUTE lproc_1;

    FETCH lproc_1 INTO :v1, :v2, :v3, ...;

    FETCH FIRST lcur_1 INTO :v1, :v2, :v3, ...;

    FETCH LAST lcur_1 INTO :v1, :v2, :v3, ...;

    FETCH NEXT lcur_1 INTO :v1, :v2, :v3, ...;

    FETCH PRIOR lcur_1 INTO :v1, :v2, :v3, ...;

    CLOSE lproc_1;


Input & output parameters are supported, except that the output parameter for a stored procedure that performs DataWindow update is unsupported.

Return value for stored procedure is supported.

Declaration syntax

All supported, except the following ...

Placing the stored procedure declaration syntax in a statement block that may not be executed at runtime is unsupported. In PowerBuilder, stored procedure declaration syntax is treated the same way as variable declaration, so the syntax will not be skipped although the statement block is not executed. However, in the mobile application, the syntax may be skipped and cause errors.

For example:

if li_length = 10 then
DECLARE proc_empl PROCEDURE FOR dbo.java_debug_request
debugger = a1,
request = a2,
out_request = a3 ;
End if
OPEN proc_empl;
FETCH proc_empl INTO :ls_emplid;

In the mobile application with the above syntax, if the li_length is not 10, the cursor declaration syntax cannot be read, and errors occur.

Arguments of stored procedures


Input, output & inout parameters is supported. The data type of the parameters should match the corresponding data type in database when you declare a stored procedure.

Multiple result sets for a stored procedure are supported.


It is unsupported to call Oracle stored procedure array argument.

User-defined data types


For the Appeon .NET edition, you can work around for SQL Server database with the following instructions.

To use the user-defined data type of SQL Server for stored procedure, you need to take the following steps to modify the configuration file:

  1. Open the configuration file named "user2systemdbtype.config" in the <AppeonServerRootDirectory>/appeon/AEM/config directory.

  2. Add data type mappings in the section named "sqlserver". For example, if you have created a user-defined data type named "mydatetime" that is derived from the system data type "datetime", you would need to set the value of the "userdefine-type" attribute to "mydatetime" and then set the value of the "system-type" attribute to "datetime" in the section named "datatype". If you have more than one user-defined data type, you should add all of them to the configuration file, as shown in the example below.

    <database name="sqlserver">
           <datatype userdefine-type="mydatetime" system-type="datetime" />
           <datatype userdefine-type="myvarchar" system-type="varchar" />
  3. Restart IIS after you make changes to the configuration file.

Calling stored procedures


Appeon provides nearly full support for calling stored procedures, except for the following requirements and unsupported features.

Requirements (For Informix database)

The sequence of input parameters must stay the same as that in the Informix database.

For example:

Create procedure ProcName (Variable1 int, Variable2 varchar(10), ...)
return varchar(10)
End procedure ProcName
Call ProcName(10,"Appeon", ...)


  • Appeon does not support using an expression as a parameter for calling the stored procedure.

  • Appeon does not support using default values for parameters in an Oracle stored procedure.

  • Appeon does not support calling an overloading stored procedure.

  • (.NET only) If the parameter is null, dynamically calling stored procedure in Informix is unsupported.

  • Offline feature does not support calling stored procedures, because UltraLite and SQLite databases do not support stored procedures.