如何使用AS创建表并在DB2中指定表空间?

huangapple go评论60阅读模式
英文:

How i can create a table using AS and specify the tablespace in db2?

问题

我试图使用"AS"创建一个表并指定表空间。
我尝试了类似以下的语句:

db2 "CREATE TABLE schema.table AS (SELECT * FROM schema.tmp) IN TABSPACE01 WITH NO DATA"

但我遇到了错误,是否可以在使用"AS"创建表时指定表空间?

英文:

I'm trying to create a table using "AS" and specify the tablespace.
I tried something like:

db2 "CREATE TABLE schema.table AS (SELECT * FROM schema.tmp) IN TABSPACE01 WITH NO DATA"

But i get a error, it's possible to specify the tablespace when creating a table with "AS"?

答案1

得分: 2

"When using a result set to create a table WITH NO DATA should follow immediately after the fullselect."

db2 "CREATE TABLE schema.table AS (SELECT * FROM schema.tmp) WITH NO DATA IN TABSPACE01"
英文:

When using a result set to create a table WITH NO DATA should follow immediately after the fullselect.

db2 "CREATE TABLE schema.table AS (SELECT * FROM schema.tmp) WITH NO DATA IN TABSPACE01"

huangapple
  • 本文由 发表于 2023年3月31日 04:46:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/75892867.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定