Defining the temp-table in 2 ways.

Kalan

Member
Hi,

Is there any advantage to define the temp-table thru Appbuilder 'Procedure Settings' menu rather than section editor?

Thanks,
Alan
 
If you use the AppBuilder to build windows that should contain UI widgets referencing fields of the Temp-Table than you have the advantage that you can select the fields from the Temp-Table in the various selectors when you define it in the procedure settings' Temp-Table maintenance tool just the same as with database fields. If you don't it doesn't matter apart from the fact that the settings you make in the procedure settings are not the most transparent. You don't see 'em in the code when you work with the section editor - you either open the file in the procedure editor or you do compile/code preview to see them. I don't like that much. Therefor I prefer to include them as include file in the definition section.

Heavy Regards, RealHeavyDude.
 
Re: Defining the temp-table in 2 ways

True, but because in procedure settings you can only define 'like' temp-tables this is simply useless... the temp-db approach looks like an unfortunate design decision to me, why would anyone create a database to store temp-tables definitions just that the AppBuilder can work with them?

Anyway, I know there was a way to trick the AppBuilder so it sees the temp-tables defined in definition section... some AppBuilder pre-processor that need to be manually updated but I don't remember exactly how right now :(
 
Re: Defining the temp-table in 2 ways

so, sort of answering my own question... more for the reference and to find it somewhere online when I need it again :)

the trick seems to be to play with the AppBuilder comment section on "procedure settings"

Code:
/* dsCustomer.i */
define temp-table ttCustomer no-undo 
    field custNum as integer
    field custName as character.


define dataset dsCustomer for ttCustomer.

Code:
&ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI
&ANALYZE-RESUME
/* Connected Databases 
*/
&Scoped-define WINDOW-NAME C-Win


/* Temp-Table and Buffer definitions                                    */
[COLOR=#ff0000]{dsCustomer.i}[/COLOR]


&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS C-Win 

...

&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
   Type: Window
[COLOR=#ff0000]   Data Source: "dsCustomer.i,ttCustomer"[/COLOR]
   Allow: Basic,Browse,DB-Fields,Window,Query
   Add Fields to: Neither
   Other Settings: COMPILE
[COLOR=#ff0000]   Temp-Tables and Buffers:[/COLOR]
[COLOR=#ff0000]      TABLE: ttCustomer D "?" :U NO-UNDO [/COLOR]
[COLOR=#ff0000]      ADDITIONAL-FIELDS:[/COLOR]
[COLOR=#ff0000]          {dsCustomer.i}[/COLOR]
[COLOR=#ff0000]      END-FIELDS.[/COLOR]
[COLOR=#ff0000]   END-TABLES.[/COLOR]
 */
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS
...

just to set the record straight and give credit where the credit is due... thank to Gabriel for helping me with that ;)


and, if you wonder why would you do that is just to be able to 'bind' fill-in's to temp-table fields in AppBuilder... makes things lot easier for lazy persons like me :)
 
Back
Top