Name resolution of SQL objects
Informix®
database[@dbservername]:][{owner|"owner"}.]identifier
The ANSI convention is to use double quotes for identifier delimiters (For example:
"customer"."cust_name"
).
Informix database object names are not case-sensitive in non-ANSI databases. When using double-quoted identifiers, Informix becomes case sensitive.
SELECT ... FROM customer WHERE ...
- The table name must include "owner", unless the connected user is the owner of the database object.
- The database server shifts the owner name to uppercase letters before the statement executes, unless the owner name is enclosed in double quotes.
Dameng®
Dameng database object names case-sensitivity is defined
by the CASE_SENSITIVE
database parameter.
In a Dameng database, tables always belong to a database schema. When executing an SQL statement, a schema name must be used as the high-order part of a two-part object name, unless the current schema corresponds to the table's schema.
The default (implicit) schema is the current user's name but it can be changed with the
ALTER SESSION SET CURRENT_SCHEMA = name
instruction.
Solution
- Use simple database object names (without any owner/schema prefix)
- Do not use double quotes to surround database object identifiers.
- If needed, define public synonyms to reference database objects in others databases/schema.
- Specify database object identifiers in lowercase.
The database parameter CASE_SENSITIVE
defines if character string comparison is
case-sensitive (Y) or case-insensitive (N). Depending on the application needs for data search, this
parameter will condition the way table and column names must be written. As a general portable SQL
pattern, always use lowercase table and column names, without double quote delimiters.
The Dameng schema concept:
ALTER SESSION SET
CURRENT_SCHEMA name
instruction if the following FGLPROFILE entry is
defined:
dbi.database.dbname.dmg.schema= "name"
Here dbname identifies the database name used in the BDL program
(DATABASE dbname
) and name is the schema name
to be used during this SQL session. If this entry is not defined, no ALTER SESSION
instruction is executed and the current schema defaults to the user's name.
dbi.database.stores.dmg.schema= "STORES1"
dbi.database.accnts.dmg.schema= "ACCSCH"