Skip to content

support for (date({fn timestampadd(SQL_TSI_YEAR, 2, date("travel_date"))})) #1139

Description

@karth06

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

Activity

  1. wumpz commented on Apr 10, 2021

    @wumpz
    Member

    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?

  2. zzt93 commented on Nov 17, 2021

    @zzt93

    I suppose parser can tell differences between the keyword and col by the function timestampadd?

  3. GilmutdinovRuslan commented on Aug 29, 2022

    @GilmutdinovRuslan

    Hi! I have the same problem,JSqlParser parses the first argument in functions TIMESTAMPADD, TIMESTAMPDIFF as a column

  4. wumpz commented on Sep 3, 2022

    @wumpz
    Member

    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.

  5. added a commit that references this issue on Sep 11, 2026
    a7a5fa5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions