开发者

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜