JSqlParser
JSqlParser copied to clipboard
support for (date({fn timestampadd(SQL_TSI_YEAR, 2, date("travel_date"))}))
Hi Want to know, do we have support for expressions like (date({fn timestampadd(SQL_TSI_YEAR, 2, date("travel_date"))})) i want to extract column name from the given expression i.e travel_date whenever i parse this expression SQL_TSI_PARSER is also getting considered as column name
SQL_TSI_PARSER? Do you mean SQL_TSI_YEAR? However, JSqlParser does parse this indeed as a column name. How should the parser differ between column names and names of internals?
I suppose parser can tell differences between the keyword and col by the function timestampadd?
Hi! I have the same problem,JSqlParser parses the first argument in functions TIMESTAMPADD, TIMESTAMPDIFF as a column
Since TIMESTAMPADD are in a sense of JSqlParser only identifier names. Therefore it results in a Column object. As I said, the parser is only a parser and has no connection to any DBMS to differ between those things.
You have to do a postparsing and correct those things according to the DBMS you are using.
However, not all DBMS know TIMESTAMPADD.