You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
support for (date({fn timestampadd(SQL_TSI_YEAR, 2, date("travel_date"))})) #1139
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?
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.
Activity
wumpz commentedon Apr 10, 2021
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?
zzt93 commentedon Nov 17, 2021
I suppose parser can tell differences between the keyword and col by the function
timestampadd?GilmutdinovRuslan commentedon Aug 29, 2022
Hi! I have the same problem,JSqlParser parses the first argument in functions TIMESTAMPADD, TIMESTAMPDIFF as a column
wumpz commentedon Sep 3, 2022
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.
fix(parser): classify ODBC timestamp interval arguments (JSQLParser#2596