开发者

In Derby DB, is it possible to add multiple columns using single query?

开发者 https://www.devze.com 2023-03-17 14:51 出处:网络
In Derby DB, is 开发者_StackOverflowit possible to add multiple columns using single query? The following are the queries I tried but didn\'t work.

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

精彩评论

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