Svetlozar Angelov
Svetlozar Angelov

Reputation: 21660

SQL - Parsing a query

I worked on a parser for arithmetic expressions. The key there was building a syntax tree, where leaves are variables and nodes are operators.

Not I'm thinking about parsing SQL queries. Parsing simple select won't be a problem, but I'm not pretty sure about the complex queries. Can you point me to a good reference about sql parsing. Thank you in advance!

Upvotes: 0

Views: 672

Answers (3)

Dan Diplo
Dan Diplo

Reputation: 25339

I'm not sure if you know C# or .NET, but LinqToSql basically does this by building expression trees that are then executed only when the query is 'called'.

Upvotes: 2

Christian13467
Christian13467

Reputation: 5584

Some codesamples: Look at sourceforge Open SQL parser. There was a question for sql parser library before. Look there.

Upvotes: 2

nos
nos

Reputation: 229058

Take a look at the SQL BNF grammars

Upvotes: 4

Related Questions