-2

I have a static temp-table in my application(with 25 fields). This needs to be a database table now, so that the user does not have to keep adding fields in the application.

The reason we do not want the static temp-table is the flexibility of adding or removing fields to the table.

I have the following temp-table

define temp-table ttQuote no-undo 
    field quote-date       as date 
    field risk                  as character 
    field client-name           as character 
    field address               as character 
    field product-code          as character 
    field risk-num              as integer 
    field risk-version          as integer 
    field risk-det-num          as integer 
    field state                 as character.

with additional fields

and the program uses the above temp-table, assigns values from different tables to its fields - and then displays the data with the help of queries.

Now, that we are replacing this temp-table with a database table and accessing the database table with a dynamic temp-table, will mean writing dynamic queries on the dynamic temp-table. So, my question was "if I have a dynamic temp-table, can I still use static queries or do I now need dynamic queries" Using additional fields would mean that the temp-table will pick the newly added fields on its own (if it is a dynamic temp-table). Please suggest.

  • The use-case seems unclear. Why or when do "users" need to add fields? Adding fields in source code requires an editor and compiler - both a user typically has no access to. Adding fields in a database requires access to the data-dictionary and still the compiler, as the application needs to be recompiled. Both is not accessible to a user too. – Mike Fechner Nov 22 '22 at 18:30
  • @MikeFechner, Thank you for looking into my query. I have explained the use case case by 'adding to answer' – Latika Sharma Nov 22 '22 at 18:53

1 Answers1

-2

An example is-

define temp-table ttQuote no-undo 
    field quote-date       as date 
    field risk                  as character 
    field client-name           as character 
    field address               as character 
    field product-code          as character 
    field risk-num              as integer 
    field risk-version          as integer 
    field risk-det-num          as integer 
    field state                 as character.

This temp-table has the fields that I want to display on my dashboard. If I need extra fields in my report, the user will have to add fields on this temp-table. So, it was suggested to have a database table so that the user can add or remove fields in the database through a maintenance screen or otherwise. And the program will not read from the temp-table now.

  • 1
    Please update your original question with clarifications – Tom Bascom Nov 22 '22 at 20:58
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 04 '22 at 17:32