IDENTITY column can be set on Teradata table. It can be done while creating a table and you can not alter once you created.
You can not say that the numbers generated by IDENTITY will always be in sequence. This is because the identity column values are generated on an amp-local basis
Syntax:
Example:
You can not say that the numbers generated by IDENTITY will always be in sequence. This is because the identity column values are generated on an amp-local basis
Syntax:
- Column_name INTEGER GENERATED ALWAYS AS IDENTITY
- (START WITH value1
- INCREMENT BY value2
- MINVALUE value3
- MAXVALUE value4
- NO CYCLE)
Example:
- CREATE TABLE tbl_emp
- (id INTEGER GENERATED ALWAYS AS IDENTITY
- (START WITH 1
- INCREMENT BY 1
- MINVALUE 0
- MAXVALUE 1000000
- NO CYCLE),
- Name VARCHAR(20),
- Phone VARCHAR(10));
No comments:
Post a Comment