Browse Prior Art Database

Method for resolving column references and expression datatypes in a parsed SQL statement Disclosure Number: IPCOM000016131D
Original Publication Date: 2002-Oct-03
Included in the Prior Art Database: 2003-Jun-21

Publishing Venue



Disclosed is a program algorithm for resolving column references and value expression datatypes in a parsed structured query language (SQL) statement. The process involves three phases: syntactic parsing, resolution of table and column references, and resolution of all other value expressions. Each phase operates on a "model" of the syntactic structure of the SQL statement. An SQL parser can handle the syntactic aspect of parsing an SQL string by using information contained in the input SQL string alone. However, the parser cannot handle some of the more semantic aspects of parsing without extra information that is not contained in the SQL statement itself. These semantic aspects include associating column references that are contained in the SQL with the tables to which the columns belong, and assigning a datatype to each value expression contained in the SQL. (Value expressions include column references, literal values such as 2 or 'Smith', numeric expressions such AGE +10, string expressions such as LASTNAME CONCAT ', CONCAT FIRSTNAME, and the like.) The three phases of the process are defined as follows. Phase 1