Backward semantic analysis of Oracle SQL
10 Aug 2000 00:06:53 -0400

          From comp.compilers

Related articles
Backward semantic analysis of Oracle SQL (2000-08-10)
Re: Backward semantic analysis of Oracle SQL (Frank Gerlach) (2000-08-13)
Re: Backward semantic analysis of Oracle SQL (2000-08-13)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 10 Aug 2000 00:06:53 -0400
Organization: Compilers Central
Keywords: analysis, optimize, question

I hope this is not off-topic. The Oracle database SQL interpreter
seems to do semantic analysis from the end of a SQL statement to the
beginning. I wonder why they do this and whether there's anything bad
about it.

Long description:

I say it semantically analyzes a SQL statement backward because if I
have two table names for which the tables do not exist (as in SELECT *
FROM NOSUCHTABLE1, NOSUCHTABLE2), it only points to the second
tablename and says it doesn't exist. If you correct it, it then points
to the first non-existing table. But in lexical analysis, it goes in
the forward direction; SELEC * FRM REALTABLE only shows an error at

I can prove that the evaluation of a SQL statement goes in the forward
direction. In SELECT FUNC1(FUNC2, FUNC3, FUNC4) FROM DUAL, the order of
function evaluation/execution is shown to be FUNC2, FUNC3, FUNC4, FUNC1
(FUNC1 in the last because of parentheses).

Back to my question. Why does Oracle check existence (and possibly user
permission) of objects referred to by identifiers in a backward order?

Yong Huang

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.