chenster / php-sql-parser

Automatically exported from code.google.com/p/php-sql-parser
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Does not work on "WITH" Clauses #136

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Oracle supports creating temporary tables for a SELECT with the WITH-Clause:

WITH myTableName AS (
select firstname, lastname from employee where lastname = 'test'
)
SELECT firstname FROM myTableName

is a valid SQL. 

Parser Message:
Fatal error: Uncaught exception 'InvalidParameterException' with message ' in 
C:\webdev\htdocs\test\sqlParser\lexer\PHPSQLLexer.ph
p on line 85

InvalidParameterException: no SQL string to parse

Original issue reported on code.google.com by ph1...@gmail.com on 24 Apr 2014 at 1:10

GoogleCodeExporter commented 8 years ago
The parser has a focus on MySQL, for Oracle you need some other parsing 
routines. It could work for some standard statements, but a special case like 
yours will produce nonsense.

See also here:
http://stackoverflow.com/questions/1382573/how-do-you-use-the-with-clause-in-mys
ql

Original comment by pho...@gmx.de on 28 Apr 2014 at 2:26

GoogleCodeExporter commented 8 years ago
I have added some code to handle simple WITH clauses (not the Oracle 12 
extensions). See r1404.

Original comment by pho...@gmx.de on 15 Sep 2014 at 12:09

GoogleCodeExporter commented 8 years ago

Original comment by pho...@gmx.de on 22 Sep 2014 at 11:49