MyTable (id identity, data CLOB)
insert some bytes into the table and return the id of the record
1. I need the generated key (identity), so I cannot use a PreparedStatement
beause with Derby, one can only get the generated key via Statement.execute (sql, RETURN_GENERATED_KEYS);
2. Hence, as a PreparedStatement cannot be used, a Statement must be used
Now, of course, I do not want (or even can) to form a String for an SQL insert statement in which the CLOB is included .
3. Euh, that brings me , in order to insert an CLOB, to create a record first, get the generated key and then update that record with the clob data
So, in 2 phases
first: id = DoInsert ();
second: DoUpdate (id,data);
Tried this as well,
if one does: stm.execute ("insert into MyTable")
or stm.execute ("insert into MyTable () values ()")
dont' go : syntax errors
So, how to insert some bytes into a table with an identity column and have the identity value as return value ??
Any solution welcome