Archives of the TeradataForum
Message Posted: Wed, 05 Mar 2008 @ 09:22:44 GMT
Using below statement I had created a table.
Create table VWPRODUCT_LEAF as (select * from vwproduct_leaf_rl) with no data;
--> VWPRODUCT_LEAF_RL is a view.
--> VWPRODUCT_LEAF table created with all columns are with NULL.
By default first column(i.e. item_ID) taken as a primary key. But I need to make composite primary key(i.e. item_id,X,Y) on VWPRDODUCT_LEAF.
When I try to Alter table with below statement
ALTER TABLE VWPRODUCT_LEAF_RPT ADD CONSTRAINT PK_VWPRODUCT_LEAF_RPT PRIMARY KEY ( ITEM_ID, x,y); ERROR: 5323: Primary key column 'ITEM_ID' must be NOT NULL
When I try to alter table with below statement for make ITEM_ID as not null
ALTER TABLE VWPRODUCT_LEAF_RPT ADD ITEM_ID NOT NULL; ERROR: ITEM_ID is a Primary Key cannot modify
Can any one tell me how can I add composite primary key to VWPRODUCT_LEAF? And how can I remove by default created Primary key on VWPRODUCT_LEAF?
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|