Kbase P129754: How to specify all fields for the temp table that load-result-into will load into?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  20/03/2008 |
|
Status: Unverified
GOAL:
How to specify all fields for the temp table that load-result-into will load into?
GOAL:
How to not to specify fields one by one for the temp table that load-result-into will load into?
FACT(s) (Environment):
Windows
OpenEdge 10.x
MS SQL DataServer
FIX:
The sample code for load-result-into specifies each field of the table when defining static temp tables. Sometimes when there are too many fields in the table, it is desirable to use "select *" to select all the fields instead of specifying fields one by one. However because progress tables are migrated and have two extra columns, the code will need to include these two fields. For example,
DEFINE VARIABLE sql-string AS CHAR INITIAL
"select * from price where thedate = 03/31/07".
DEF TEMP-TABLE tt1 LIKE price
FIELD PROGRESS_recid AS INTEGER
FIELD PROGRESS_RECID_IDENT_ AS INTEGER.
DEFINE VARIABLE tth AS HANDLE NO-UNDO.
tth = TEMP-TABLE tt1:HANDLE.
RUN STORED-PROC send-sql-statement LOAD-RESULT-INTO tth (sql-string).
FOR EACH tt1.
DISP sedol thedate.
END.