PBDR.COM

About   -   Contact   -   Purchase   -   Search   -   What's New

 
 
Faster Store Procedures through External Function Calls
New to PowerBuilder 4 was the ability to declare none result set stored procedures inside the transaction object. This has many benefits:
  • Speed, because PowerBuilder always knows about the procedure it does not need to verify that the SQL is valid and knows it does not have to prepare for a result set.
  • Compact code, because you declare the procedure as a function of the transaction object you do not need to declare the procedure in every script that you call the procedure.
  • Common place, when you want to change the arguments to a procedure call you can make the modification in one standard place.

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

 

Top of Page

Legal Notice

Ken Howe 2011