Release 10.1A: OpenEdge Development:
ADM Reference

> ## callstringtt.p

> The `callstringtt.p` procedure is similar to `callstring.p`, except that it allows you to pass up to 64 temp-tables that function as parameters to the invokeCall procedure.

> In addition to the behavior provided by `callstring.p`, `callstringtt.p` also allows the caller to provide a mapping between the 64 temp-tables being passed and the appropriate parameter to the call.

> The code in Example A–1 illustrates an example procedure that you might need to call in a server-side procedure.

> Example A–1: Example server-side procedure
>     /* customerbl.p */
>     …
>     PROCEDURE obtainCustomerData:
>       DEFINE INPUT PARAMETER phCustomerTempTable AS HANDLE.
>       DEFINE INPUT PARAMETER pcSessionID AS CHARACTER.
>       DEFINE INPUT PARAMETER phOrderBuffer AS HANDLE.
>       /* Process the customer temp-table and order buffer */
>     END.

> The code in Example A–2 illustrates making a call to the `obtainCustomerData` procedure. In this example, the procedure passes the handle to the temp-table as the first parameter and the buffer handle for the order temp-table as the second parameter.

> Note: Example A–2 illustrates code for use in a non-dynamics environment because it uses a procedure file.

> Example A–2: Making a call to the obtainCustomerData procedure
>     RUN adm2/callstringtt.p
>       ("obtainCustomerData",  /* call to make */
>        "customerbl.p",        /* procedure to use */
>        "INPUT HANDLE 'T:01', INPUT CHARACTER cSessionID, INPUT HANDLE
>     'B:02'",                  /* parameter list */
>        "",                    /* Tables to skip */
>        INPUT-OUTPUT TABLE ttCust,
>        INPUT-OUTPUT TABLE ttOrder,
>        INPUT-OUTPUT TABLE-HANDLE hTT03,
>        INPUT-OUTPUT TABLE-HANDLE hTT04,
>        INPUT-OUTPUT TABLE-HANDLE hTT05,
>        INPUT-OUTPUT TABLE-HANDLE hTT06,
>        INPUT-OUTPUT TABLE-HANDLE hTT07,
>        INPUT-OUTPUT TABLE-HANDLE hTT08,
>        INPUT-OUTPUT TABLE-HANDLE hTT09,
>        INPUT-OUTPUT TABLE-HANDLE hTT10,
>        ...
>        INPUT-OUTPUT TABLE-HANDLE hTT64
>        ).

> You must specify each `TABLE-HANDLE` you want to pass in a remote call. As a result, to make a remote call to the AppServer, you must specify all 64 TABLE-HANDLEs. To do this efficiently, you can specify the TABLE-HANDLE parameters using the include file `callttparam.i` located in the `src/adm2/` directory. Before using this include file, you must define an array of handles with an extent of 64.

> To do this, you could modify the code in Example A–2 as follows:

>     DEFINE VARIABLE hTT AS HANDLE EXTENT 64 NO-UNDO.
>     RUN adm2/callstringtt.p
>       ("obtainCustomerData",  /* call to make */
>        "customerbl.p",        /* procedure to use */
>        "INPUT HANDLE 'T:01', INPUT CHARACTER cSessionID, INPUT HANDLE
>     'B:02'",                  /* parameter list */
>        "",                    /* Tables to skip */
>        {src/adm2/callttparam.i
>         &ARRAYFIELD = "hTT"
>         &T01 = "TABLE ttCust"
>         &T02 = "TABLE ttOrder"}
>        ).

> The syntax highlighted in bold in the Example A–2 modified code deserves some additional explanation:

>     "INPUT HANDLE 'T:01', INPUT CHARACTER cSessionID, INPUT HANDLE 'B:02'"

> The first and third parameters in the string correspond to the first and second temp-tables being passed as indicated by the 01 and 02 values after the colon. Note that the `T:` or `B:` that precedes the number indicates whether to pass a TEMP-TABLE (T) or BUFFER (B) handle to the procedure being called. As a result, the passing order of the temp-tables in the include file does not need to be the same order used by the call. The order used in the call is determined by the subscript that follows the `T:` or `B:`.

> For more information, see the "Temp-table include files" section and the "Temp-table types" section.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095