Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top