hi..how to create a dynamic temp-table and then create a new record for this temp-table??thanks in advance
Do you have a piece of non-working code?
The online help for the CREATE TEMP-TABLE statement has a good sample:
DEFINE VARIABLE tth AS HANDLE NO-UNDO.
DEFINE VARIABLE bh AS HANDLE NO-UNDO.
DEFINE VARIABLE qh AS HANDLE NO-UNDO.
DEFINE VARIABLE buf-ord-hndl AS HANDLE NO-UNDO.
DEFINE VARIABLE buf-rep-hndl AS HANDLE NO-UNDO.
DEFINE VARIABLE fld1 AS HANDLE NO-UNDO.
DEFINE VARIABLE fld2 AS HANDLE NO-UNDO.
/* Get database table handles */
buf-ord-hndl = BUFFER Order:HANDLE.
buf-rep-hndl = BUFFER SalesRep:HANDLE.
/* Create an empty, undefined TEMP-TABLE */
CREATE TEMP-TABLE tth.
/* Give it Order table’s fields & indexes */
tth:CREATE-LIKE(buf-ord-hndl).
/* Add field like SalesRep.RepName */
tth:ADD-LIKE-FIELD("RepName","SalesRep.RepName").
/* No more fields will be added */
tth:TEMP-TABLE-PREPARE("ordx").
/* Get the buffer handle for the temp-table */
bh = tth:DEFAULT-BUFFER-HANDLE.
bh then is the handle of the temp-tables default-buffer.
Use the
bh:BUFFER-CREATE()
method to create a record.
actually i copy Order table to temp-table (ttOrder) using buffer-copy to copy whole record from Order table..then i try to add a record into this ttOrder just using
create ttOrder. never mind,i'll try with buffer-create first,then i will tell u my progress..thanks..