The Wayback Machine - https://web.archive.org/web/20211021133834/https://github.com/JSQLParser/JSqlParser/issues/1363
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Oracle-flavor multiple drop column case #1363

Closed
ashleycoxley opened this issue Oct 11, 2021 · 2 comments
Closed

Missing Oracle-flavor multiple drop column case #1363

ashleycoxley opened this issue Oct 11, 2021 · 2 comments

Comments

@ashleycoxley
Copy link

@ashleycoxley ashleycoxley commented Oct 11, 2021

Thanks for the great parser. I noticed that it's missing support of the Oracle way to drop multiple columns in a single statement. Here's the Oracle syntax to drop multiple columns (source):

ALTER TABLE [schema].[table] DROP COLUMN ([col1], [col2]);

When parsing, it throws this error:

Encountered unexpected token: "(" "("
at line 1, column 31.

Was expecting one of:

"COLUMN"
"CONSTRAINT"
"INDEX"
<S_IDENTIFIER>
<S_QUOTED_IDENTIFIER>

Java version 8, JSqlParser version 4.2

@manticore-projects
Copy link
Contributor

@manticore-projects manticore-projects commented Oct 11, 2021

Thank you for reporting, its a Duplicate of #1245.

manticore-projects added a commit to manticore-projects/JSqlParser that referenced this issue Oct 18, 2021
@manticore-projects
Copy link
Contributor

@manticore-projects manticore-projects commented Oct 18, 2021

Should be fixed, but please verify your example.
According to https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_3001.htm#i2103683 you can have

  1. Single Column Drop using the COLUMN keyword or
  2. Multi Column Drop without the COLUMN keyword

So you example would still fail, but the following will work:

ALTER TABLE foo DROP (bar, baz) CASCADE;

Do let me know any issues or concerns.

@wumpz wumpz closed this in #1379 Oct 20, 2021
wumpz pushed a commit that referenced this issue Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants