DROP TABLE IF EXISTS subscription;
CREATE TABLE subscription(
subscription_id INTEGER,
account_id INTEGER,
expire_date DATE,
create_date INTEGER) ;
COPY subscription FROM '/home/dbadmin/scr/subscription.csv' DELIMITER AS ',' NULL AS 'null' ;
DELETE FROM subscription where subscription_id=100234;
TRUNCATE TABLE subscription;
Dropping a table with dependencies like foreign key and Projections, must be removed before proceeding to drop.
To remove projections, use cascade option.
[Error Code: 3128, SQL State: 2BV01] [Vertica][VJDBC](3128) ROLLBACK: DROP failed due to dependencies
[Vertica][VJDBC]Detail: Cannot drop Table sales because other objects depend on it
Code: 4927 SQL State: 01000 --- The Projection sales_p2_b0 depends on Table sales
Code: 4927 SQL State: 01000 --- The Projection sales_p2_b1 depends on Table sales
Code: 4927 SQL State: 01000 --- The Projection sales_p2_b2 depends on Table sales
Code: 4927 SQL State: 01000 --- The Projection sales_p1_node0001 depends on Table sales
Code: 4927 SQL State: 01000 --- The Projection sales_p1_node0002 depends on Table sales
Code: 4927 SQL State: 01000 --- The Projection sales_p1_node0004 depends on Table sales
DROP TABLE IF EXISTS Sales CASCADE;
Follow the link to drop foreign key constraint.
Thursday, June 23, 2016
Basic operations on a table in Vertica
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment