Referencing objects owned by the database owner  Determining whether an identifier is valid

Chapter 4: Expressions, Identifiers, and Wildcard Characters

Using qualified identifiers consistently

When qualifying a column name and table name in the same statement, be sure to use the same qualifying expressions for each; they are evaluated as strings and must match; otherwise, an error is returned. Example 2 is incorrect because the syntax style for the column name does not match the syntax style used for the table name.

Example 1

select demo.mary.publishers.city from demo.mary.publishers

city ----------------------- Boston Washington Berkeley

Example 2

select demo.mary.publishers.city from demo..publishers

The column prefix "demo.mary.publishers" does not match a table name or alias name used in the query.





Copyright © 2005. Sybase Inc. All rights reserved. Determining whether an identifier is valid

View this book as PDF