Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted
Updated 14-May-12 0:13am
v4

Updated below

SQL
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')


Hope this helps if yes then accept and vote the answer otherwise revert back with your queries.
--RDBurmon Sr.Software Engineer
 
Share this answer
 
v2
Here is the sample method to achieve:

C#
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]);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900