SQL parser in C

2019-02-07 00:57发布

I want to parse and store the columns and values of a SQL DML (INSERT, UPDATE, DELETE) statement in C. Need the URL of the open source code or a library with which I can link my C program. The platform is SUSE Linux. Have tried to make and use libSQL unsuccessfully. A detailed answer is appreciated. Thanks.

Additional Notes: Please suggest a library/code that I can link with my C program. In my program I want to use the functions of this library to parse and use the tokens for further processing.

标签: sql c parsing
8条回答
做自己的国王
2楼-- · 2019-02-07 01:43

Not sure is there any mature C sql parser can do that easily.

Here is a Java version SQL library can do what you need exactly, it can be used to Retrieve/Refactor table & column name from a complex SQL query easily.

查看更多
Emotional °昔
3楼-- · 2019-02-07 01:53

Have you considered writing your own using lex and yacc? (the hacker - hardcore approach)

Not trivial .. but this site might help you get started

查看更多
登录 后发表回答