Database Remote Proc Support
\The Sandbox \PB History & Future \New in PB 4 \DB Enhancements \Remote Procedure
Array Fetches
in Oracle 7
Bind Variables
Cached
Statements
Select & DB
Painters
Remote Procedure
Informix
ODBC
Oracle 7
Peformance
Gains
Cache in
Oracle
SQL Server
System 10
Watcom 4.0

Support for Database Remote Procedures has been enhanced. You will now be able to use object.function notation for calling non-result set stored procedures. Using this new method will also give you increased performance. It provides support for Oracle PL/SQL tables and parameters that are defined as both input and output. It will also allow for overloaded procedures.

In addition to Oracle, you will be able to call database procedures in Sybase, Informix Watcom, and other ODBC databases with stored procedures using this method.

The following steps describe the new method of calling database remote procedures:

User Object painter

  1. Create a new standard class user object inherited from the type transaction.
  2. Declare local external functions.

The syntax for declaring an RPC as an external function is similar to declaring any external function. The difference is that the keyword RPCFUNC is used instead of LIBRARY. If you want to use an alias, you must us the syntax, ALIAS FOR.

Syntax

FUNCTION  rtndatatype functionname ( { REF } { datatype1 arg1, ..., datatypen argn } )       RPCFUNC {ALIAS FOR spname}

If a function does not return a value (for example, it returns Void), the syntax for the external function declaration is:

SUBROUTINE  rtndatatype  functionname  ({REF}{ datatype1 arg1 , ..., datatypen argn })       RPCFUNC {ALIAS FOR spname}

 

Argument

Description

rtndatatype

The data type of the value returned by the function.

functionname

The name of the database procedure name.

Note: If you want to use an alias, then functionname should be the name of the function you want to use in PowerBuilder.

datatype1 to datatypen (optional)

The data types of the arguments (if any) specified in arg1 to argn.

arg1 to argn (optional)

The names of arguments in the function.

spname (optional)

The name of the procedure in the database.

Application painter

Change default global variable type for SQLCA from transaction to name of standard class user object.

PowerScript painter

Code function in PowerScript. Here is an example of using the Local External Function in PowerScript:

    int myresult
    myresult = SQLCA.spm8(myresult)
    if SQLCA.sqlcode <> 0 then
    messagebox("Error", SQLCA.sqlerrtext)
    end if 

PBL Peeper PB Help PB History
& Future About Us Feedback Site Map

Google
 
Web www.techno-kitten.com
www.sybase.com