本文介绍了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?

推荐答案

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


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解析器-条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 21:54