How to avoid writing the owner (pub) of the table (schema) before referencing the table name in the SQL commands

por | 9 julio, 2020
Option #1
Use the following statement in the same SQL session prior to running any SQL statements:

set schema ‘pub’

Where ‘owner’ is the owner name, e.g. ‘PUB’.

It will be valid until the end of the session or until it is changed.

Option #2
If using an ODBC DSN, set the default schema to the owner in the DSN settings

Windows:
In the Windows registry, create a «DefaultSchema» string value for the ODBC DSN being used and set the value to the owner of the schema (for example, «PUB»).

Windows 32-bit
User DSN: HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\<DSN name>
System DSN: HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\<DSN name>

Windows 64-bit
User DSN: HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\<DSN name>
System DSN 64-bit: HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\<DSN name>
System DSN 32-bit: HKEY_LOCAL_MACHINE\Software\Wow6432Node\ODBC\ODBCI.INI\<DSN name>

UNIX:
Add the DefaultSchema parameter to the relevant DSN section in the ODBC.INI file:

DefaultSchema=owner            

Where ‘owner’ is the owner name, e.g. ‘PUB’.

Option #3
Using JDBC add defaultSchema connection parameter to the URL:

jdbc:datadirect:openedge//myhost:6718;databaseName=sports2000;defaultSchema