When you insert a row into a table with an IDENTITY column, SAP ASE automatically generates the column value. Do not include the name of the IDENTITY column in the column list or its value in the values list.
This insert statement adds a new row to the sales_daily table. The column list does not include the IDENTITY column, row_id:
insert sales_daily (stor_id) values ("7896")
create table idtext (a int, b numeric identity, c char(1)) ------------------- (1 row affected)
insert idtext values(98,"z") ------------------- (1 row affected
insert idtest values (99, "v")) --------------------
(1 row affected)
select * from idtest --------------------- 98 1 z 99 2 v
(2 rows affected)
The following statement shows the row that was added to sales_daily. SAP ASE automatically generates the next sequential value, 2, for row_id:
select * from sales_daily where stor_id = "7896"
sale_id stor_id ------- ------- 1 7896 (1 row affected)