I need a Delphi 6 compatible function that will be used in another application:
Function CrystalToSQL( CRSQL: TStrings ): TStrings;
Objective: Given a Crystal Reports SQL Query, parse the query and strip out the elements that are not acceptable to Postgres or a traditional SQL query.
Details: The two sample SQL files provided contain the specific elements that need to be stripped from the SQL query, and both can be identified by the presence of curly braces {}.
A) If there's an outer join, Crystal codes it this way:
{oj (table1, table 2, etc) }
It needs to be coded this way:
(table1, table2, etc)
Bothe braces and the "oj" need to be removed
B) If there are DateTime (Timestamp) fields in the Where clause, Crystal codes it this way:
WHERE ("genericalert"."insertiontime">={ts '2003-12-01 18:09:59'} AND "genericalert"."insertiontime"<{ts '2003-12-31 18:10:00'})
It needs to be coded this way:
WHERE ("genericalert"."insertiontime">='2003-12-01 18:09:59’ AND "genericalert"."insertiontime"<'2003-12-31 18:10:00')
Again, the braces and the "ts" need to be removed
C) Return the result as a Tstrings object. Crystal doesn't use anything but item 0, and the return value can be the same.
D) The sample files are representative of the SQL strings that need to be processed. Some effort should be made to anticipate variation in the source strings, but it's more important that it process these samples, and that I get the function as soon as possible.
E) Execution speed is not as important as accuracy.
IMPORTANT: If any 3rd party libraries are required, I must be informed in advance, and I must be able to obtain source code. The cost of getting these components will affect my decision to award this project.
## Deliverables
1) Delphi 6 source code
2) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).
## Platform
Windows