PL/SQL解析器-条件 [英] PL/SQL parser - Where condition

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

问题描述


我想使用C#解析PL/SQL的where条件. 就像这样
dynamic__9888500000002894.product_id = dynamic__9888500000002907.text_1和dynamic__9888500000002894.code_1 = dynamic__9888500000002907.text_2或dynamic__9888500000002894.code_2 = dynamic__9888500000002907.text_3不在dynamic__9888500000002894.code_2 =``AA''

基本上我想基于and,or等来拆分条件

Hi,
I would like to parse the where condition of PL/SQL using C#.
It would be something like this
dynamic__9888500000002894.product_id = dynamic__9888500000002907.text_1 and dynamic__9888500000002894.code_1 = dynamic__9888500000002907.text_2 or dynamic__9888500000002894.code_2 = dynamic__9888500000002907.text_3 not in dynamic__9888500000002894.code_2 = ''AA"

basically i want to split the conditions based on and,or etc
Could you please help me to solve this?

推荐答案

已在下面更新

Updated below

dynamic__9888500000002894.product_id = dynamic__9888500000002907.text_1 
and 
dynamic__9888500000002894.code_1 = dynamic__9888500000002907.text_2 
or 
dynamic__9888500000002894.code_2 = dynamic__9888500000002907.text_3 
and
dynamic__9888500000002894.code_2 not in  ('AA')



希望这对您有帮助,然后接受并投票答复,否则将返回您的查询.
--RDBurmon高级软件工程师



Hope this helps if yes then accept and vote the answer otherwise revert back with your queries.
--RDBurmon Sr.Software Engineer


以下是实现的示例方法:

Here is the sample method to achieve:

string InputString = "......";
string[] delimiters = new string[] { "and", "or"; };
string[] parts = InputString.Split(delimiters,
                 StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < parts.Length; i++)
{
    Console.WriteLine(parts[i]);
}


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

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