In Derby DB, is it possible to add multiple columns using single query?
In Derby DB, is 开发者_StackOverflowit possible to add multiple columns using single query?
The following are the queries I tried but didn't work.
ALTER TABLE <table_name>
ADD (COLUMN col_1 VARCHAR(2), COLUMN col_2 VARCHAR(2));
ALTER TABLE <table_name>
ADD COLUMN (col_1 VARCHAR(2), col_2 VARCHAR(2));
Not in one statement. But you can issue multiple DDL statements in a single transaction, just like regular UPDATE-s. Then the changes will "happen" (become visible outside the transaction) atomically: at the same time, all or nothing.
Alternatively, statements only need be separated by a semicolon, thus can be typed in one line if that's what you are after...
精彩评论