解析SQL查询 [英] Parsing sql queries

查看:115
本文介绍了解析SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用SL4.其实我的问题有点不同.
我在WHERE,ORDER BY和AND运算符的基础上解析SQL查询并进行过滤.仅当有字符串过滤器和IN运算符并且字符串包含WHERE,ORDER BY或AND词时,事情才能正常工作
有没有更好的方法来解析查询?

问候.

Hi guys,
I am working with SL4. Actually my problem is a bit different.
I am parsing SQL queries and filtering on the basis of WHERE, ORDER BY and AND operators. Things work fine only if there is a string filter and IN operator and if string contains WHERE, ORDER BY or AND word
is there any better way to parse queries?

Regards.

推荐答案

也许是使用 http://www创建SQL解析器的时候.antlr.org/可能更好,或者使用现有的语法^ _ ^ http://www .antlr.org/grammar/1279318813752/PLSQL.g
maybe if you create your SQL parser by using http://www.antlr.org/ can be better, or use an exists grammars ^_^ http://www.antlr.org/grammar/1279318813752/PLSQL.g


这篇关于解析SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆