Reputation: 11
I am working on SAS and I don't have knowledge on Db2 and Netezza. Now my requirement is to migrate below code from DB2 to Netezza. So could you please help me out on this?
Here is my code:
CREATE TABLE acct_grp_holder (
acct_num CHAR(7) NOT NULL,
grp_num CHAR(9) NOT NULL
)
PARTITIONING KEY (grp_num)
IN ts_mdc1 /*Not aware what's the meaning of IN here*/
ORGANIZE BY (grp_num)
NOT LOGGED INITIALLY
);
Thanks in advance.
Upvotes: 0
Views: 260
Reputation: 3887
Without knowing the intended use for the table (e.g. if this for permanent user or part of your data preparation process for use in SAS), here is starting point for your conversion.
CREATE TABLE acct_grp_holder (
acct_num CHAR(7) NOT NULL,
grp_num CHAR(9) NOT NULL
)
DISTRIBUTE ON (grp_num)
--DISTRIBUTE ON RANDOM
ORGANIZE ON (grp_num)
;
The PARTITIONING KEY clause is roughly equivalent to the Netezza DISTRIBUTE ON clause. However, without knowing anything about your data, we can't tell if using "DISTRIBUTE ON RANDOM" would be a better fit.
The ORGANIZE BY clause in the original indicates an MDC table. The ORGANIZE ON clause in the Netezza is a rough conceptual fit for this.
There is no need, or ability, to specify as tablespace for the table (the IN clause) or logging behavior.
Upvotes: 1