CREATE TABLE PRODUCT
ProdNo Integer NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1,INCREMENT BY 1, NO MAXVALUE, NO CYCLE, ORDER),
Prod_Name Varchar(30) NOT NULL,
I am developing a JSP application that allows user to enter data into the datavbase. however i face a problem when i tried to insert in the data. I go the error telling me that no values were specified for the auto generated column. Is that anyway to solve this? It seems like the auto column is not able to insert a value before i insert my data.
don't know how you are inserting your data from the jsp application .
But if you were using simple sqls then your insert statement should not have any reference to the auto generated column and DB2 will generate th value for you. e.g. insert into product (prod_name) values ('test').
Check whether running this bit of sql from the CLP generates the prodno value as 1