Hi I'm using open edge 10.2b
I have a program thats got a browse that displays a temp table ttRecs. In this instance it’s defined like a database table grades. I want to use a dynamic query/temp table to get all the grades records (to start with) and then display them in a browse. Now the reason im using a temp table in my browse is that the column labiling and widths etc aren’t brilliant straight from the database. So thus I do a display in my browse and name my columns etc.
I’m trying to use dynamic query/table within a template to try and make my code more genric so my idea is that I have my ttRecs in my browse and do I dynamic query/table then past the results to ttRecs (so the display is correct). But I haven’t worked out how to do it and I was wondering if anyone knew?
Heres what I’ve got so far
so any suggests would be good really i'd like a dynamic temp table so i can query later in the code if i want rather than building it all up again.
I have a program thats got a browse that displays a temp table ttRecs. In this instance it’s defined like a database table grades. I want to use a dynamic query/temp table to get all the grades records (to start with) and then display them in a browse. Now the reason im using a temp table in my browse is that the column labiling and widths etc aren’t brilliant straight from the database. So thus I do a display in my browse and name my columns etc.
I’m trying to use dynamic query/table within a template to try and make my code more genric so my idea is that I have my ttRecs in my browse and do I dynamic query/table then past the results to ttRecs (so the display is correct). But I haven’t worked out how to do it and I was wondering if anyone knew?
Heres what I’ve got so far
Code:
define variable hTempTable as handle no-undo.
DEFINE VARIABLE qh AS HANDLE NO-UNDO.
/*chrMyTable = grades in this case*/
CREATE BUFFER hTempTable FOR TABLE chrMyTable.
CREATE QUERY qh.
qh:SET-BUFFERS(hTempTable).
qh:QUERY-PREPARE("FOR EACH " + chrMyTable + " NO-LOCK").
qh:QUERY-OPEN().
qh:GET-FIRST().
REPEAT:
qh:GET-NEXT().
IF qh:QUERY-OFF-END THEN LEAVE.
buffer-copy hTempTableto ttRecs. /*how can i put what ive got in the handle into the temp table*/
end.
so any suggests would be good really i'd like a dynamic temp table so i can query later in the code if i want rather than building it all up again.