Skip to content

Alter tab support for 'change' #380

Closed

Description

@HeleneLf

This script cannot be parsed : Alter table X change column a b Double null default null;
It throws :
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " <S_IDENTIFIER> "CHANGE "" at line 5, column 1.
Was expecting one of:
"DROP" ...
"ADD" ...

Please add support for CHANGE.

Regards

Activity

  1. wumpz commented on Jan 11, 2017

    @wumpz
    Member

    Pull requests are wellcome. Or is this something your want to contribute to differently ?

  2. HeleneLf commented on Jan 11, 2017

    @HeleneLf
    Author

    This is a request, not a pull request sorry, I am new to gitHub.

  3. wumpz commented on Jan 11, 2017

    @wumpz
    Member

    ??? Where is the source code of your pull request? Did I overlooked it?

  4. wumpz commented on Jan 11, 2017

    @wumpz
    Member

    No problem, I was only kind of suprised ;).

  5. liuluheng commented on May 23, 2017

    @liuluheng

    also not support ALTER TABLE tALTER COLUMNc set default 1;

  6. wumpz commented on May 23, 2017

    @wumpz
    Member

    Which database supports 'change'? I only know 'modify'.

  7. Gikkman commented on Feb 1, 2019

    @Gikkman
    Contributor

    Ah, I came here looking for a solution to this issue too.
    MySQL supports a query for the following form:

    ALTER TABLE model CHANGE modelid modeluid INT(10) UNSIGNED NOT NULL;

    As explained in this StackOverflow answer, CHANGE is used to rename a column. So what the above query means is basically "Change column modelid, rename it to modeluid, and then do the following changes to its type".

    Edit: To expand this a bit, there is also a syntax for renaming tables using the ALTER statement. It is a pretty deep hole, but there is a good reference here under the header Rename column in table and Rename table

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