IDENTITY
Description
The IDENTITY function is a system function that operates on a specified column of a table to determine the initial value for the identity. If the initial value is not available, it defaults to the value provided in the function. This will be translation to a Sequence in Snowflake.
Grammar Syntax
"identity"(oid_id, oid_table_id, default)Sample Source Patterns
Input Code:
CREATE TABLE IF NOT EXISTS table_test
(
id integer,
inventory_combo BIGINT DEFAULT "identity"(850178, 0, '5,3'::text)
);
INSERT INTO table_test (id) VALUES
(1),
(2),
(3),
(4);
SELECT * FROM table_test;id
inventory_combo
1
5
2
8
3
11
3
14
Output Code:
id
inventory_combo
1
5
2
8
3
11
3
14
Related EWIs
There are no known issues.
Last updated
