Table Qualifiers

Statements that reference database tables, views, or synonyms (either alone, or as qualifiers of database column names) can include table qualifiers:

4GLREF00000226.gif

database is the name of a database containing the table, view, or synonym.

owner is the login name of the owner of the table, view, or synonym whose identifier immediately follows the table qualifier.

server is the name of the host system where database resides. Blank spaces are not valid after the @ symbol.

Table qualifiers can appear in SQL and other 4GL statements, and in table alias declarations in the TABLES section of form specifications. You cannot, however, prefix a table alias or a field name with a table qualifier. Except in table alias declarations within the TABLES section, you cannot include table qualifiers anywhere in a form specification file.

Owner Naming

The qualifier can specify the login name of the owner of the table. You must specify owner if table.column is not a unique identifier within its database.

ANSI In an ANSI-compliant database, you must qualify each table name with that of the owner of the table (owner.table). The only exception is that you can omit the owner prefix for any tables that you own. For example, if Les owns table t1, you own table t2, and Sasha owns table t3, then you could use the following statement to reference three columns in those tables:

VALIDATE var1, var2, var3 LIKE les.t1.c1, t2.c2, sasha.t3.c3

You can include the owner name in a database that is not ANSI-compliant. If the owner is incorrect, however, 4GL generates an error.

Database References

When INFORMIX-NET PC accesses an INFORMIX-OnLine database across a network, table qualifiers can include the database name. This example from a form specification defines aes as an alias for a table in the aliena database:

TABLES aes = aliena:cesar.receivables

The LIKE clause of 4GL statements like DEFINE, INITIALIZE, and VALIDATE can use this database: or database@server: notation in table qualifiers to specify tables in a database other than the default database. Without such qualifiers, 4GL looks for the table in the default database. Even if the table qualifier includes a database reference, however, the LIKE clause will fail unless you also include a DATABASE statement before the first program block in the same module to specify a default database.

The current database is the database specified by the most recently executed DATABASE statement in a MAIN or FUNCTION program block in the same module. 4GL programs can include SELECT statements that query a table in an INFORMIX-OnLine database that is not the current database, but they cannot insert, update, nor delete rows from any table that is not in the current database.

If the current database is supported by the INFORMIX-OnLine database engine and by INFORMIX-STAR, a table reference can also include @server to specify the name of another host system on which a table resides.

LOAD FROM "fyl" INSERT INTO dbas@hostile:woody.table42

SE Only the databases stored in your current directory, or in a directory specified in your DBPATH environment variable, are recognized. Table qualifiers cannot include references to an INFORMIX-SE database.

ANSI If the current database is ANSI-compliant, a run-time error results if you attempt to query a remote database that is not ANSI-compliant.

References

DATABASE

DEFINE

INITIALIZE

LOAD

VALIDATE

UNLOAD