Kbase P80833: Does Progress Query/Results support the use of the Progress 4GL TEMP-TABLES?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/17/2004 |
|
Status: Unverified
GOAL:
Does Progress Query/Results support the use of the Progress 4GL TEMP-TABLES?
FIX:
No, the Progress Query/Results application does not directly support the use of the 4GL TEMP-TABLES.
A possible workaround is to temporarily create real tables, activate results, generate the report(s) needed and drop these newly created table(s) after the report(s) are generated.
Such a solution would use the SQL-89 syntax to CREATE and DROP these tables and go along the following lines:
CONNECT sports2000 -1. /* connect to the database */
RUN CreatemyCustomer.p. /* Create the new table(s) */
RUN PoulatemyCustomer.p. /* Populate the newly created table(s).
RUN Results.p. /* Run Results and generate the report(s) needed */
RUN DropmyCustomer.p. /* Delete the newly created table(s) */
Where:
/* CreatemyCustomer.p ? A procedure to create the new table(s) */
CREATE TABLE Mycustomer (
custnum integer FORMAT '>>>>9' LABEL 'Cust Num' DEFAULT 0,
country character (20) NOT CASE-SENSITIVE FORMAT 'x(20)' LABEL 'Country' DEFAULT 'USA',
name character (30) NOT CASE-SENSITIVE FORMAT 'x(30)' LABEL 'Name',
address character (35) NOT CASE-SENSITIVE FORMAT 'x(35)' LABEL 'Address',
address2 character (35) NOT CASE-SENSITIVE FORMAT 'x(35)' LABEL 'Address2',
city character (25) NOT CASE-SENSITIVE FORMAT 'x(25)' LABEL 'City',
state character (20) NOT CASE-SENSITIVE FORMAT 'x(20)' LABEL 'State',
postalcode character (10) NOT CASE-SENSITIVE FORMAT 'x(10)' LABEL 'Postal Code',
contact character (30) NOT CASE-SENSITIVE FORMAT 'x(30)' LABEL 'Contact',
phone character (20) NOT CASE-SENSITIVE FORMAT 'x(20)' LABEL 'Phone',
salesrep character (4) NOT CASE-SENSITIVE FORMAT 'x(4)' LABEL 'Sales Rep',
creditlimit decimal FORMAT '->,>>>,>>9' LABEL 'Credit Limit' DEFAULT 1500,
balance decimal FORMAT '->,>>>,>>9.99' LABEL 'Balance' DEFAULT 0,
terms character (20) NOT CASE-SENSITIVE FORMAT 'x(20)' LABEL 'Terms' DEFAULT 'Net30',
discount integer FORMAT '>>9%' LABEL 'Discount' DEFAULT 0,
comments character (80) NOT CASE-SENSITIVE FORMAT 'x(80)' LABEL 'Comments',
fax character (20) NOT CASE-SENSITIVE FORMAT 'x(20)' LABEL 'Fax',
emailaddress character (50) NOT CASE-SENSITIVE FORMAT 'x(50)' LABEL 'Email'
).
/* PoulatemyCustomer.p - A procedure to populate the new table(s) */
FOR EACH customer NO-LOCK:
CREATE myCustomer.
BUFFER-COPY customer TO myCustomer.
END.
/* DropmyCustomer.p. - A procedure to deletes the new table(s) */
DROP TABLE mycustomer.