AI Assistant: {ALL_TABLES} and other variables

Holger Dors

Member²
Hi Marco,

is it possible to select a sub set of {ALL_TABLES} for the AI Assistant? Something like {TABLES SELECT="select table_name from user_tables where table_name not like 'TMP%'"} or provide a View with the desired tables?

I am also missing a documentation as to what the variuos variables are actually doing. Like what information is {TABLE_CONTEXT} actually sending to the model?

Is there some kind of log that I could check? I tried double clicking on a usage entry, but that didn't do anything. :)

Thanks!
Holger
 
is it possible to select a sub set of {ALL_TABLES} for the AI Assistant? Something like {TABLES SELECT="select table_name from user_tables where table_name not like 'TMP%'"} or provide a View with the desired tables?
This is currently not possible. The {ALL_TABLES} variable includes all tables owned by the current user. I have added a filter option to the list of enhancement requests.

I am also missing a documentation as to what the variuos variables are actually doing. Like what information is {TABLE_CONTEXT} actually sendin[qitg to the model?
The variables are documented in the "Prompt engineering" paragraph of chapter 16.3 (AI Configuration). The complete documentation of the {TABLE_CONTEXT} variable is as follows:

TABLE_CONTEXT [ITEMS = ] [PREFIX = ] [SUFFIX = ]

This variable is replaced by the table and view definitions for all tables and views referenced in the {USER_INPUT} and {EDITOR_TEXT}.

The ITEMS parameter allows you to limit the table definition text to one or more item types:

ITEMS = [COLUMNS, PK, UK, FK, CK, COMMENTS]

For example, the parameter expression ITEMS = "COLUMNS, COMMENTS" will include just the columns and their comments, and will exclude the primary key, unique key, foreign key, and check constraint definitions.

The PREFIX and SUFFIX text will be included before or after the table definitions. If no tables definitions are included, the prefix and suffix text is omitted.
 
Hi Marco,

thanks, I accidentially skipped over the definitions! :cry:

Unfortunately, according to my OpenAI Log (and the answer it returns), this is not the case for all tables that I reference in my prompt, only the first table is used. As I don't know how you manage that, is there some "trick" or "best practice" as to where to list the tables that should be used? I have them scattered throughout my prompt: should I list them at the start? (I am using the "Create" prompt.)

Thanks
Holger
 
Unfortunately, according to my OpenAI Log (and the answer it returns), this is not the case for all tables that I reference in my prompt, only the first table is used
Can you let me know what exactly goes wrong? Can you provide an example?

As I don't know how you manage that, is there some "trick" or "best practice" as to where to list the tables that should be used? I have them scattered throughout my prompt: should I list them at the start?
The table name(s) can be placed anywhere in the prompt.
 
Here is an example prompt:

Create a new company "Mexico" with code "MX" (T$COMPANIES).
Create the appropriate language for this: 'Spanish-Mexico', 'es-MX' (T$LANGUAGES, T$C_T$L).
Create the appropriate pricelist: 'MXN' (T$PRICELISTS).
Company is abbreviated as "c", language as "l" and pricelist as "pl" .
Use sequences t$c_id, t$l_id and t$pl_id with function NextVal and CurrVal in the insert statements.
Ignore all protocol columns

Only the context for T$COMPANIES was sent to the AI. Once I prefixed the prompt with the line "T$COMPANIES T$LANGUAGES T$C_T$L T$PRICELISTS" the context of all four tables was sent.
 
Last edited:
It turned out that the problem is caused by symbol characters followed by a period character in the prompt, such as ").". If you omit the period characters, it should work fine.

We have fixed this bug for the next patch release. If you want a pre-release, let me know.
 
Back
Top