By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,260 Members | 1,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,260 IT Pros & Developers. It's quick & easy.

Open source SQL Parser using C++

P: n/a
nik
Hi,

I need to parse incoming SQL statements (SELECT, INSERT, DELETE etc)
and generate a parse tree. Also i need to find out if there are syntax
errors etc.

Is there any open source SQL Parser which i can use? Also at some
point, i would need to support join etc also so i would need some sort
of SQL Optimizer or Query processor also.

I want to provide SQL interface to a non-sql db which has its own
access APIs. So idea is to tokenize in-coming SQL, validate it and
then using a mapper, access the non-sql db and return the results.

Any comment or input appreciated...If some one has more better design
alternative or open source product which can do the similar task, it
is also welcome.

Thanks in advance,

Mar 16 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
nik wrote:
[..]
Is there any open source SQL Parser which i can use? [..]
Isn't there an SQL newsgroup where you could ask? Parsing
SQL in C++ is NOT C++-specific. It's SQL-specific. That
makes your question off-topic, sorry. Also, GIYF.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 16 '07 #2

P: n/a
On Mar 16, 6:45 pm, "nik" <nikv...@gmail.comwrote:
Hi,

I need to parse incoming SQL statements (SELECT, INSERT, DELETE etc)
and generate a parse tree. Also i need to find out if there are syntax
errors etc.

Is there any open source SQL Parser which i can use? Also at some
point, i would need to support join etc also so i would need some sort
of SQL Optimizer or Query processor also.

I want to provide SQL interface to a non-sql db which has its own
access APIs. So idea is to tokenize in-coming SQL, validate it and
then using a mapper, access the non-sql db and return the results.

Any comment or input appreciated...If some one has more better design
alternative or open source product which can do the similar task, it
is also welcome.

Thanks in advance,
MySql may include the codes of parse SQL statements.

Mar 16 '07 #3

P: n/a
On 16 Mar 2007 03:45:45 -0700, "nik" <ni*****@gmail.comwrote:
>I need to parse incoming SQL statements (SELECT, INSERT, DELETE etc)
and generate a parse tree. Also i need to find out if there are syntax
errors etc.
Is there any open source SQL Parser which i can use? Also at some
point, i would need to support join etc also so i would need some sort
of SQL Optimizer or Query processor also.
I want to provide SQL interface to a non-sql db which has its own
access APIs. So idea is to tokenize in-coming SQL, validate it and
then using a mapper, access the non-sql db and return the results.
Any comment or input appreciated...If some one has more better design
alternative or open source product which can do the similar task, it
is also welcome.
What you describe is far from trivial. SQLite, a widely-used public
domain database, contains what you want but not packaged as library:
http://www.sqlite.org/arch.html

Best wishes,
Roland Pibinger
Mar 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.