GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE] missing feature description START WITH NN in ORACLE throws a JSQLParserException · Issue #1791 · JSQLParser/JSqlParser

[FEATURE] missing feature description START WITH NN in ORACLE throws a JSQLParserException #1791

New issue
Copy link
New issue
Copy link
Closed
#1778
Closed
[FEATURE] missing feature description START WITH NN in ORACLE throws a JSQLParserException#1791
#1778
Copy link

Description

@ndepomereu
ndepomereu
opened on May 15, 2023
Issue body actions

The START WITH NN in ORACLE is not supported.

I mean JsqlParser cannot parse an Oracle Table that has a START WITH NN.
(Don't know if this is a feature request or a bug).

For example; this table is not parsable:

-- location
CREATE TABLE locations
  (
    location_id NUMBER GENERATED BY DEFAULT AS IDENTITY START WITH 24 
                PRIMARY KEY       ,
    address     VARCHAR2( 255 ) NOT NULL,
    postal_code VARCHAR2( 20 )          ,
    city        VARCHAR2( 50 )          ,
    state       VARCHAR2( 50 )          ,
    country_id  CHAR( 2 )               , -- fk
    CONSTRAINT fk_locations_countries 
      FOREIGN KEY( country_id )
      REFERENCES countries( country_id ) 
      ON DELETE CASCADE
  );

It raises a JSQLParserException:
Encountered unexpected token: "START" "START"

If I remove START WITH 24 , the table is parsable.

Best,
N.

Activity

  1. manticore-projects commented on May 15, 2023

    @manticore-projects
    manticore-projects
    on May 15, 2023
    Contributor
    More actions

    It's most likely a bug. Please look at the Syntax: https://jsqlparser.github.io/JSqlParser/syntax.html#createparameter
    START WITH number is not defined.

    Without any promise, I will have a look at this tomorrow.
    The CREATE ... and ALTER ... statements need a serious refactoring.

  2. manticore-projects commented on May 15, 2023

    @manticore-projects
    manticore-projects
    on May 15, 2023
    Contributor
    More actions

    Btw, if you want to test various statements and understand, why/where they fail then you can do this here and interactively

    Based on the Grammar, I have no idea how GENERATED BY DEFAULT AS IDENTITY passes. But I will figure this out tomorrow. I assume it is just a chain of tokens (without any interpretation).

  3. manticore-projects commented on May 15, 2023

    @manticore-projects
    manticore-projects
    on May 15, 2023
    Contributor
    More actions

    Ok, as expected the whole GENERATED BY DEFAULT AS IDENTITY START WITH 24 is not really parsed and interpreted but just taken as a chain of S_IDENTIFIER (which is a Token).

    Since START is a Token also, it clashes (since in the chain, only words that are no tokens are allowed).
    I will work around this by allowing certain non-reserved keywords and/or adding START to the CREATE PARAMETERS.

    But you still will just get a list of tokens, not really an interpretation of their meaning.

  4. manticore-projects
    added a commit that references this issue on May 15, 2023

    fix: issue JSQLParser#1791

    88d1b62
  5. manticore-projects commented on May 15, 2023

    @manticore-projects
    manticore-projects
    on May 15, 2023
    Contributor
    More actions

    Fixed via 88d1b62 in PR #1778

  6. ndepomereu commented on May 15, 2023

    @ndepomereu
    ndepomereu
    on May 15, 2023 via email
    Author
    More actions
    Hi, Thanks, this is not urgent for me, I can get around it by suppressing the START WITH NN. Don't know if my input could interest you and your community, but maybe: I provide a tool that works only on metadata, so I ask the users to import their schema and I parse it. My objective is to parse the schema with the least errors possible, of course. The purpose is that my users see tables, columns, and primary keys only. My goal is that they are no failures when importing their schema in my tool. Failures that I don't anticipate are a pain because I must report, and tell users they must hack their schema source before import... I'm testing all majors databases with the most famous tutorial series for MySQL, PostgreSQL, SQL Server, and Oracle. For now, results with JSqlParser are very, very good. The only 2 problems I met have been : - Not supporting the:: in nextval with PostgreSQL. - Not supporting the START WITH NN with Oracle database. So, as I work on the metadata level, I'm able to discard the problems, while keeping the base declaration, and my users don't even notice the problem. Hope this helps. Continue on the great work with JSQLParser! Best, Nicolas Le lun. 15 mai 2023, 21:18, manticore-projects ***@***.***> a écrit :
    It's most likely a bug. Please look at the Syntax: https://jsqlparser.github.io/JSqlParser/syntax.html#createparameter START WITH number is not defined. Without any promise, I will have a look at this tomorrow. The CREATE ... and ALTER ... statements need a serious refactoring. — Reply to this email directly, view it on GitHub <#1791 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADQ7CVWHYVDCC266O3LFQ73XGJ6RHANCNFSM6AAAAAAYCTTN4U> . You are receiving this because you authored the thread.Message ID: ***@***.***>
    Nicolas de Pomereu KawanSoft SAS http://www.kawansoft.com 128, Rue La Boétie 75008 Paris - France Tel: +33 (0)1 77 69 59 58
  7. manticore-projects
    added a commit that references this issue on Jun 1, 2023

    JSQLParser 5.0 (#1778)

    41b6fce
  8. manticore-projects
    closed this as completedin #1778on Jun 1, 2023
  9. manticore-projects
    added a commit that references this issue on Jun 15, 2023

    Assorted Fixes #8 (#1807)

    a815f5f
  10. manticore-projects
    added a commit that references this issue on Jun 27, 2023

    Backslash Quotation of Single-Quote `'\\''` (#1813)

    c79dfff
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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.