I have one combo box having names of all the tables. Inside one procedure i want to get the value from combo box(ie the name of the table) and want to create temp table for that dynamically .. Need help on this please..
Asked
Active
Viewed 1,531 times
1 Answers
4
Given that you have a handle to your ComboBox-Widget, you can create a new temp-table dynamically like this:
DEF VAR ttH AS HANDLE.
CREATE TEMP-TABLE ttH.
ttH:CREATE-LIKE(ComboBoxWidgetHandle:SCREEN-VALUE).
This now takes the ScreenValue of the ComboBox Widget and uses the CREATE-LIKE method of the TempTable Object handle to create a TempTable with the exactly same fields as the table in the database. This only works if ComboBoxWidgetHandle:SCREEN-VALUE is exactly the same as a table name in the database, for instance 'Customer' in the SportsDB.

LyrixDeRaven
- 538
- 3
- 9
-
Thanks for the reply. I got it working.I was not aware about SCREEN-VALUE. I just started learning Progress. – Bhavin Bhaskaran Feb 02 '12 at 10:33
-
sure, no worries, that's what we're here for! – LyrixDeRaven Feb 02 '12 at 10:39
-
Don't forget to delete the temp table if you no longer need it. – carl verbiest Dec 01 '15 at 06:42