retrieveTEMP-TABLE SCHEMA

Posted by Admin on 12-Jan-2007 07:34

Is there a way that I can retrieve the SCHEMA of a TEMP-TABLE at run time something like

for each _file,

each _field of _file ....

which I can do with database TABLES, so I can get the attributes at run time and make some Dynamic Programming based on what the schema is at run-time.

Thanks

Hugo

hmercado@comdist.com

All Replies

Posted by Admin on 12-Jan-2007 07:54

How about querying the TABLE-HANDLE:DEFAULT-BUFFER-HANDLE?

ASSIGN hTable = TEMP-TABLE ttYourTableName:HANDLE

hBuffer = hTable:DEFAULT-BUFFER-HANDLE.

Look for NUM-BUFFER-FIELDS and BUFFER-FIELD methods and attributes for the Buffer Object Handle.

Posted by Alon Blich on 12-Jan-2007 10:00

I think, that TEMP-TABLE VST's are in the works.

You might want to look at the WRITE-XMLSCHEMA method.

Posted by Admin on 12-Jan-2007 10:16

VSTs for Temp-Table Schema? Do you know more about that?

Posted by Alon Blich on 12-Jan-2007 13:20

I think that I may have heard what I wanted to hear. After a quick check I found it was requested by developers at Exchange last year but nothing about any plans.

IMHO this like the native timer are among the things that seem almost obvious and we've been waiting for someone to get around and finishing them.

Posted by gus on 15-Jan-2007 13:19

For now at least, the only way to get the information you need is via the buffer handles. The reason you can't use technique of

for each _file,

each _field of _file ....

is that unlike real datbase tables, temorary tables have no stored schema -- they don't need any. The schema is defined in the 4GL when you define a temp table and its indexes. This is then processed by the compiler and included in the r-code, but in a completely different form thatn it is in the database schema tables, which are real tables by the way. If the schema tables (_file, _field, _index, etc.) were actually created and filled in, it would add a bunch of overhead which is not needed most of the time.

I'm not claiming this is ideal, just explaining how it is done.

-gus

Posted by Alon Blich on 15-Jan-2007 14:05

Cool, I've just found the index-information( ) method and it's been there for quite a while.

So I guess we've got everything ! very, very cool

This thread is closed