Reputation: 81
When I try to generate a default increment it works just fine, but adding START WITH, INCREMENT BY throws an error. I'm using DB 11.3 so it should be supported, pic with error attached
Upvotes: 0
Views: 1253
Reputation: 645
The square brackets are used to identify optional values - took me a few tries to get the syntax right...
%sql CREATE
OR REPLACE TABLE products (
product_id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 100 INCREMENT BY 1),
product_type STRING,
sales BIGINT
);
INSERT INTO products (product_type, sales)
VALUES ("Batteries", 150000);
INSERT INTO products (product_type, sales)
VALUES ("lAPTOP", 100000);
Hope it helps...
Upvotes: 1