Skip to content

Support expressions with ":". #1134

Closed
Closed

Description

@LonwoLonwo

Describe the bug
Some Databases, like Informix, have a sign ":" as delimiter name of the database and schema name.
https://www.ibm.com/support/knowledgecenter/en/SSGU8G_14.1.0/com.ibm.sqls.doc/ids_sqs_1652.htm
This is not a completely accurate link, but here the use of a colon is mentioned.

To Reproduce
Steps to reproduce the behavior:
use "SELECT * FROM stores_demo:informix.accounts;" with Informix database and get

net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: ":" ":"
    at line 2, column 17.
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:26538)
	at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:26377)
	at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:91)

dbeaver/dbeaver#11590

Expected behavior
Please add colon support as a separator between the database name and the schema name.

System

  • Informix Dynamic Server 14.10.FC4W1
  • jsqlparser:4.0

Activity

  1. added a commit that references this issue on Mar 20, 2021
  2. wumpz commented on Mar 20, 2021

    @wumpz
    Member

    I kind of introduced this parsing half way. Now you are able to parse it, but the deparser is not there. Producing the source SQL results in the point way again.

  3. wumpz commented on Mar 25, 2021

    @wumpz
    Member

    @LonwoLonwo Does it work?

  4. LonwoLonwo commented on Mar 29, 2021

    @LonwoLonwo
    Author

    Hello, @wumpz
    Sorry for late response.
    Yes, it works for parsing.
    I don't now your workflow, so I just say - ticket can be closed.

  5. manticore-projects commented on Aug 6, 2021

    @manticore-projects
    Contributor

    Closed on behalf of the author.

  6. manticore-projects commented on Nov 16, 2024

    @manticore-projects
    Contributor

    @LonwoLonwo

    we are facing a problem here: in any modern RDBMS : is a Json Operator for EXTRACT FROM PATH e. g.:

    -- DataBricks/Snowflake
    SELECT c1:price j
        FROM VALUES('{ "price": 5 }') AS T(c1);
    
    -- Postgres
    SELECT c1::JSON -> 'price' j
        FROM VALUES('{ "price": 5 }') AS T(c1);

    It is impossible to support both at the same time, but we could apply a Configuration Switch, e. g. an INFORMIX mode for you.
    I definitely need this JSON support, but I also want to support your needs -- so please make a wish on what would be the best way forward on this rather exotic feature.

  7. manticore-projects commented on Nov 16, 2024

    @manticore-projects
    Contributor

    I have solved it by allowing : for Table names only, while : will return a JSOnExpression everywhere else.

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