How to create a temp-table with dynamic array size

h.schilleman

New Member
I want to create a temp-table with fields that are arrays. But I want the size of each array to be dependent of the number of records from another table. I this possible ??

Regards Hans.
 
yes, it's possible.

Code:
DEFINE VARIABLE tth AS HANDLE     NO-UNDO.
CREATE TEMP-TABLE tth.
tth:ADD-NEW-FIELD("array_field","integer",<another_buffer_handle>:NUM-FIELDS).
tth:TEMP-TABLE-PREPARE("tt").
 
if you mean, what i think you mean.

that every record ( i'm talking about the same table ) has or could
have different array size

then no. at least not this way. records datatypes, extents ( array
size ) are fixed.


but how about using a delimited string. character field.

you could use a regular comma for a delimiter or special character like
chr(1) depending on what it is you're planning to put in them.


i gathered from your post that its a parent child table relationship.

if the data is one per every child record why not put the field in the
child table. hth
 
Back
Top