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
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.
I think, that TEMP-TABLE VST's are in the works.
You might want to look at the WRITE-XMLSCHEMA method.
VSTs for Temp-Table Schema? Do you know more about that?
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.
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
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