I am trying to come up with a DB2 SQL statement that does the following, but I'm not sure if this is allowed.
I know that this is possible insert into tableA ( ... ) Values (?,?,?,...)
and then assign values to these parameters ?.
Is it possible to pre-determine the value of one of the parameters?
For example, one of the columns I'm trying to insert is this ID column, and I would like to do something like select max(id) + 1 from tableA.
This is what I'm trying to get to - is this syntax possible in db2?
insert into tableA (ID, Text1, Text2) VALUES (select max(id)+1 from tableA, ?, ?)
In any case - any help would be appreciated!
thank!!
source
share