Tutorial by Examples

This is the definition of a TEMP-TABLE named ttTempTable with three fields. NO-UNDO indicates that no undo handling is needed (this is usually what you want to do unless you really need the opposite). DEFINE TEMP-TABLE ttTempTable NO-UNDO FIELD field1 AS INTEGER FIELD field2 AS CHARACTER ...
Temp-tables can (and should) be created with indices if you plan to run queries against them. This table has one index (index1) containing of one field (field1). This index is primary and unique (meaning not two records can have the same contents of field1). DEFINE TEMP-TABLE ttTempTable NO-UNDO ...
You can define multiple indices for each temp-table. If you need them - define them. Basically an index matching your query and/or sort order will help performance! DEFINE TEMP-TABLE ttWithIndex NO-UNDO FIELD field1 AS INTEGER FIELD field2 AS CHARACTER FIELD field3 AS LOGICAL IN...
It's very simple to pass temp-tables in and out of programs, procedures and functions. This can be handy if you want a procedure to process a bigger number of data than you can easily store in a string or similar. You can pass temp-tables as INPUT, OUTPUT and INPUT-OUTPUT data. Inputting one temp-...

Page 1 of 1