简体   繁体   English

从正在进行的组合框中创建表名称以创建临时表4gl,Open Edge

[英]Creating Temp-Table taking the table name from combo box in progress 4gl, Open Edge

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.. 在一个过程中,我想从组合框中获取值(即表的名称),并希望为该表动态创建临时表。请对此提供帮助。

Given that you have a handle to your ComboBox-Widget, you can create a new temp-table dynamically like this: 假定您拥有ComboBox-Widget的句柄,则可以像这样动态创建一个新的临时表:

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. 现在,这将使用ComboBox窗口小部件的ScreenValue,并使用TempTable对象句柄的CREATE-LIKE方法创建一个TempTable,其字段与数据库中的表完全相同。 This only works if ComboBoxWidgetHandle:SCREEN-VALUE is exactly the same as a table name in the database, for instance 'Customer' in the SportsDB. 仅当ComboBoxWidgetHandle:SCREEN-VALUE与数据库中的表名完全相同(例如,SportsDB中的“客户”)时,此方法才有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM