Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move columns in java DB Apache Derby?

Tags:

jdbc

derby

javadb

I need to change specific column's position I tried Ted Hopp's solution in Move Column in MYSQL

ALTER TABLE EMPLOYEES MODIFY COLUMN fname VARCHAR(25) AFTER password

and i got this error:

Error code -1, SQL state 42X01: Syntax error: Encountered "MODIFY" at line 1, column 22.

So any idea how to do it with Derby

like image 286
user2954718 Avatar asked Jul 03 '26 04:07

user2954718


1 Answers

Derby uses ADD COLUMN (docs):

ALTER TABLE EMPLOYEES ADD COLUMN fname VARCHAR(25)

There is no way to insert columns before or after a certain column; they are always appended.

like image 90
Aaron Digulla Avatar answered Jul 06 '26 01:07

Aaron Digulla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!