Kbase 18508: 4GL. Passing Temporary Tables as Parameters -- Sample Program
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/10/2008 |
|
Status: Verified
GOAL:
Passing Temporary Tables as Parameters
FACT(s) (Environment):
Progress 8.x
Progress 9.x
FIX:
TEMP-TABLE names are different in the code sample, but note that the table names may be the same if you wish. This is also true for the field names, but in all cases the table signatures (i.e., number of columns, data type of each column, etc.) must be identical.
/********* pass-t-t.p *********/
DEFINE TEMP-TABLE pass-table
FIELD pass_contact AS CHARACTER FORMAT "X(20)"
FIELD pass_country AS CHARACTER FORMAT "X(20)"
FIELD pass_balance AS DECIMAL
FIELD pass_discount AS INTEGER.
DO:
for each customer where cust-num < 30:
CREATE pass-table.
ASSIGN
pass_contact = customer.contact
pass_country = customer.country
pass_balance = customer.balance
pass_discount = customer.discount.
end.
RUN catch-t-t.p
(INPUT TABLE pass-table).
end.
/********** catch-t-t.p **********/
define temp-table catch-table
FIELD catch_contact AS CHARACTER FORMAT "X(20)"
FIELD catch_country AS CHARACTER FORMAT "X(20)"
FIELD catch_balance AS DECIMAL
FIELD catch_discount AS INTEGER FORMAT "-z9%".
DEFINE INPUT PARAMETER TABLE FOR catch-table.
FOR EACH catch-table NO-LOCK.
DISPLAY
catch-table.
END.