1

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..

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
Bhavin Bhaskaran
  • 572
  • 5
  • 17
  • 41

1 Answers1

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