Skip to main content
Skip table of contents

NAME_RESOLUTION_ORDER


Using this option, you can enable or disable resolving of non-fully qualified names in user queries.

Resolving of non-fully qualified names applies to tables, views, and stored procedures. Hereinafter, these entities are referred to as resources or group symbols.

Enabling Non-Fully Qualified Names Resolution

There are two ways to enable the non-fully qualified names resolution, depending on whether you need to enable it for the current session or globally: by using the SET statement or by calling the SYSADMIN.setDefaultOptionValue() stored procedure.

Using SET Statement

In this case, the option becomes valid only for the current session.

The example below demonstrates enabling the names resolution with the SET statement:

SQL
SET $NAME_RESOLUTION_ORDER "test_tables_pg, test_tables";;
SET $NAME_RESOLUTION_ORDER "*";;
SET $NAME_RESOLUTION_ORDER "-";;

Using Stored Procedure

In this case, the option is set globally.

The example below demonstrates enabling the names resolution by calling the stored procedure:

SQL
CALL SYSADMIN.setDefaultOptionValue("opt" => 'NAME_RESOLUTION_ORDER', "val" => '-');;
CALL SYSADMIN.setDefaultOptionValue("opt" => 'NAME_RESOLUTION_ORDER', "val" => '*');;
CALL SYSADMIN.setDefaultOptionValue("opt" => 'NAME_RESOLUTION_ORDER', "val" => 'schema1, schema2');;
CALL SYSADMIN.setDefaultOptionValue("opt" => 'NAME_RESOLUTION_ORDER', "val" => 'schema1, schema2, *');

Options

The table below summarizes the values allowed for this option:

To view the full table, click the expand button in its top right corner


Option valueDescription
-Fully qualified names are always required; default value
*Look in all schemas as in the previous implementation. The main difference is that now the resolution algorithm takes into account also the user rights on the resource and two different error messages ("Group is ambiguous" or "User has no rights") can be shown depending on the number of discovered resources accessible to the user. Some examples will be shown in the next section.
<comma separated list of schemas>Look in these schemas exactly in this order. If the resource is defined in more than one schema provided in the list, the name will be resolved using the first schema in the order containing the resource; if the resource is not defined in these schemas, the system will throw a "Table/View/Proc/ not found..." exception. More examples will be shown in the following section.
<comma separated list of schema> + "*" symbolLook in these schemas as for the previous option. If the resource is defined in none of these schemas but it is defined multiple times in other schemas, the system will throw a "Group specified is ambiguous..." error.

Usage Examples

The following table shows some examples (this table does not cover all possible combinations) of the system behaviour when running a query like SELECT * FROM <non-fully qualified table name>:

To view the full table, click the expand button in its top right corner


NAME_RESOLUTION_ORDERsch1Rights on sch1sch2Rights on sch2schXRights on schXschYRights on schYResult
-(question)(question)(question)(question)(question)(question)(question)(question)The query always fails if the table name is not fully qualified
"sch1, sch2"(error)(tick)(tick)(tick)(error)(question)(error)(question)sch2
"sch1, sch2"(error)(tick)(tick)(error)(error)(question)(error)(question)"No permissions..." error
"sch1, sch2"(tick)(tick)(tick)(tick)(tick)(tick)(error)(question)sch1
"sch1, sch2"(tick)(error)(tick)(tick)(tick)(tick)(error)(question)sch2
"sch1, sch2"(error)(error)(error)(error)(tick)(tick)(error)(question)"Table not found" error
"sch1, sch2"(error)(error)(error)(error)(error)(error)(error)(question)"Table not found" error
"sch1, sch2, *"(tick)(tick)(error)(error)(error)(error)(error)(question)sch1
"sch1, sch2, *"(tick)(tick)(tick)(tick)(error)(error)(error)(question)sch1
"sch1, sch2, *"(tick)(error)(tick)(tick)(tick)(tick)(error)(question)sch2
"sch1, sch2, *"(tick)(tick)(error)(error)(tick)(tick)(error)(question)sch1
"sch1, sch2, *"(error)(error)(error)(error)(tick)(tick)(error)(question)schX
"sch1, sch2, *"(error)(error)(error)(error)(tick)(tick)(tick)(tick)"Group specified is ambiguous..." error
"sch1, sch2, *"(tick)(error)(tick)(error)(tick)(error)(error)(question)"Table not found" error
*(error)(question)(error)(question)(error)(question)(error)(question)"Table not found" error
*(tick)(tick)(tick)(tick)(error)(question)(error)(question)"Group specified is ambiguous..." error
*(tick)(error)(error)(error)(error)(question)(error)(question)"No permissions..." error
*(tick)(tick)(tick)(error)(error)(question)(error)(question)sch1

Legend:

(error) – the schema has no tables with this name

(tick) – the schema contains a table with this name

(question) – for the resolution, it does not matter if the schema contains such a table or not

For the rights column:

(error) – no permission

(tick) – user has permissions on the schema/table

(question) – does not matter

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.