Try OpenEdge Now
skip to main content
.NET Open Clients
Passing Parameters : Passing TABLE and TABLE-HANDLE parameters : Temp-table examples : Sample static temp-table
 
Sample static temp-table
The following example shows a static temp-table definition in a persistent procedure, PaymentInfo.p.

Static temp-table in a persistent procedure

DEFINE TEMP-TABLE PaymentInfoTT
  FIELD payment-date AS DATE
  FIELD payee-id     AS INTEGER
  FIELD payee-name   AS CHARACTER
  FIELD amount       AS DECIMAL
  FIELD cleared      AS LOGICAL.

PROCEDURE getPaymentsInfo:
  DEFINE INPUT  PARAMETER fromDate AS DATE.
  DEFINE OUTPUT PARAMETER TABLE FOR PaymentInfoTT.
For this parameter, ProxyGen generates the following:
*PaymentInfoTT.cs with the following class definition:
Acme.StrongTypesNS.PaymentInfoTTDataTable
*The following method in the proxy:
public void getPaymentsInfo(System.DateTime fromDate,
        out Acme.StrongTypesNS.PaymentInfoTTDataTable PaymentInfoTT)
The following example shows a static temp-table definition in an external procedure, setPaymentInfo.p.

Static temp-table in an external procedure

DEFINE TEMP-TABLE MySetPaymentInfoTT
  FIELD payment-date   AS DATE
  FIELD payee-id       AS INTEGER
  FIELD payee-name     AS CHARACTER
  FIELD amount         AS DECIMAL
  FIELD cleared        AS LOGICAL.

DEFINE INPUT PARAMETER TABLE FOR MySetPaymentInfoTT.
Since the schema for these two static temp-table parameters is the same, ProxyGen uses the previously generated, strongly typed DataTable in the proxy method generated for this external procedure. For example:
public void setPaymentInfo(System.DateTime fromDate,
        out Acme.StrongTypesNS.PaymentInfoTTDataTable MySetPaymentInfoTT)
For INPUT and INPUT-OUTPUT parameters, the .NET client code must supply an instance of the strongly typed DataTable object. For OUTPUT parameters, the strongly typed DataTable variable must be declared, but the instance is created by ABL and returned to the .NET client.