Allowing custom SQL to pass through the parser
We use a few custom SQL codes in our application which basically help with reports by doing a string-substitution when the SQL is executed.
Example:-
We have a number of tokens like @CURRENTUSER and @LOGONDT
When our DB engine executes queries it simply replaces such tokens with the appropriate value.
Please can you tell me how to allow custom syntax like this through your SQL parser so that they don't get flagged as errors?
Thanks.
Example:-
We have a number of tokens like @CURRENTUSER and @LOGONDT
When our DB engine executes queries it simply replaces such tokens with the appropriate value.
Please can you tell me how to allow custom syntax like this through your SQL parser so that they don't get flagged as errors?
Thanks.
@@startdate:datetime
...which instructs our application to display a dialog box requesting user input on a date/time value which then gets substituted in. In the same way you could stipulate :-
@@description:string
@@num_occurrences:int
...and so on.
In all such cases we need to either pre-process the SQL (and preserve it) before the SQL parser reports errors or we need to tell the SQL parser what to allow and what to dis-allow.
I look forward to your help - thanks!