Write or preferably enhance existing code to parse Oracle OR SqlServer SQL SELECT statements.
The goals are:
1) Parse out the selected "fields" in such a way that they can be used in populating a filter. This would also mean excluding constants from field list since filtering on COL4 if it is in select as 'ABC' as COL4 makes no sense. However, COL1 + ', ' + COL2 as CO4 would be valid.
2) Determine where in selected statement the filter is to go.
3) Locate where supplied parameters are to go (typically in where clauses) AND COL1 = :MyArg
Note the routine must be able to correctly parse very complex SQL containing functions, sub selects, unions, etc.
Thus, if ...,COL1,CASE WHEN [url removed, login to view] IS NOT NULL THEN FUNC1([url removed, login to view]) ELSE '' END AS COL2, ...
is part of select then filter would have label like "Col2" and if user specified Col2 should contain '12' the filter may look like
... AND (CASE WHEN [url removed, login to view] IS NOT NULL THEN FUNC1([url removed, login to view]) LIKE %12%) AND ...
and need to be placed in proper spot in a select that may or may not have a WHERE clause or may have several where clauses that are part of sub-selects, etc.
We have existing code that does a of this reasonably well, but still has issues. That could be used as starting point or some other existing open source or proprietary code could be suggested provided the licensing does no require releasing our code that makes used of it (GPL, etc.) Ideal solution would be a rules based lex type parser. GPL code can be considered if author is willing to grant us an alternate licence (perhaps for a fee) that is is more acceptable to us. We would need the source and would prefer it be in Delphi and be currently supported by author. If a fee to use code is required, we would have to agree to it, but would be willing to pay the fee.
You will be interfacing with another Delphi developer. We just have too many projects to focus on on this now and thought it would be a good thing to outsource.
General SQL Parser VCL version may be a good starting point or something based on a grammar like http://www.felix-colibri.com/papers/db/sql_parser/sql_parser.html. (However, I've had trouble reaching felix recently to work out licensing issues.)
14 freelancers están ofertando el promedio de $552 para este trabajo
Hello, I am happy to create such a parser for you. I have been working with Delphi for more then 10 years...I also familiar with complex queries in Oracle, I am writing them too...
Dear friend , I have experience with delphi please reference programs that I done use delphi: [login to view URL] Look forward to working with you!! Best Regards Duc