cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikos Paraschou <nipar...@gmail.com>
Subject INSERT with raw_sql_query returns error
Date Tue, 24 Aug 2010 20:59:32 GMT
  Hello,

I have created the following raw sql query inside Cayenne Modeler:

insert into $schema.$table (#bind($columns)) values(#bind($values))

To run it from a java application I use this code:

String[] keys = new String[] {"schema", "table", "columns", "values"};
Object[] values = new Object[] {schema, table, columnNames, columnValues};
NamedQuery query = new NamedQuery("myQuary", keys, values);
context.performQuery(query);

columnNames and columnValues are both ArrayLists. The binding of the 
values to their keys seems to work fine (according to the log messages 
when the query is run). Unfortunately, I keep getting a 
CayenneRuntimeException caused by:

com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-727, 
SQLSTATE=56098, SQLERRMC=2;-104;42601;(?,?,?,?,?,?,?,?,?,?,?,?,?) 
values|AL_STATS_WITH_ID_WCT|<, DRIVER=3.57.82

Am I doing something wrong? I am using Cayenne version 3.

Thank you,
Nikos

Mime
View raw message