This section describes the naming conventions for tables and columns in local SQL.

Tables

Local SQL supports full file and path specifications for table names. Table names with a path, spaces, or other special characters in their names must be enclosed in single or double quotation marks. You may use forward slashes instead of backslashes. For example,

SELECT * FROM PARTS.DB // Simple name with extension; no quotes required

SELECT * FROM "AIRCRAFT PARTS.DB" // Name has space; quotes needed

SELECT * FROM "C:\SAMPLE\PARTS.DB" // Filename with path

SELECT * FROM "C:/SAMPLE/PARTS.DB" // Forward slash instead of backslash

Local SQL also supports BDE aliases for table names. For example,

SELECT * FROM :IBAPPS:KBCAT

If you omit the file extension for a local table name, the table is assumed to be the table type specified the current setting of SET DBTYPE.

Finally, local SQL permits table names to duplicate SQL keywords as long as those table names are enclosed in single or double quotation marks. For example,

SELECT PASSID FROM "PASSWORD"

Columns

Local SQL supports multi-word column names and column names that duplicate SQL keywords as long as those column names are

Enclosed in single or double quotation marks

Prefaced with an SQL table name or table correlation name

For example, the following column name is two words:

  SELECT E."Emp Id" FROM EMPLOYEE E

In the next example, the column name duplicates the SQL DATE keyword:

  SELECT DATELOG."DATE" FROM DATELOG