From: Grzes_P on
J have database DB2 and create table T_TEST with fields:
ID - integer autoincrement
NAME - varchar(50)
QTY - Integer

I create java bean CMP and install it on Jboss server and when create new
record from client I get error:

com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -798, SQLSTATE:
428C9, SQLERRMC: ID

I get the same error when execute command:
Insert into T_test (id,name,qty ) values (10,'OK',12)

and when execute :
Insert into T_test (name,qty ) values ('OK',12)
.... all is OK!!!

how to configure Jboss ?

Please Help!!!

thanks







From: db2admin on
you are specifying value for column which is supposed to be auto
generated
that is the cause of error you are getting
here is the explanation from db2
=========================================================
SQL0798N A value cannot be specified for column
"<column-name>" which is defined as GENERATED ALWAYS.

Explanation:

When inserting or updating a row in a table, a value was
specified for the GENERATED ALWAYS column "<column-name>".
GENERATED ALWAYS columns should not be specified in the
column-list for an INSERT or in the SET clause for an update
unless the keyword DEFAULT is specified.

The INSERT or UPDATE is not performed.

User Response:

Remove the GENERATED ALWAYS column from the column-list or SET
clause, or specify DEFAULT as the column value.

sqlcode : -798

sqlstate : 428C9
====================================================================



On Mar 2, 5:09 am, "Grzes_P" <grzesi...(a)wp.pl> wrote:
> J have database DB2 and create table T_TEST with fields:
> ID - integer autoincrement
> NAME - varchar(50)
> QTY - Integer
>


> I create java bean CMP and install it on Jboss server and when create new
> record from client I get error:
>
> com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -798, SQLSTATE:
> 428C9, SQLERRMC: ID
>
> I get the same error when execute command:
> Insert into T_test (id,name,qty ) values (10,'OK',12)
>
> and when execute :
> Insert into T_test (name,qty ) values ('OK',12)
> ... all is OK!!!
>
> how to configure Jboss ?
>
> Please Help!!!
>
> thanks