I'm very new to Matlab and I'm trying to update a cell into a Postgresql table.
This is my code
s=size(o,1);
for n=1:1:s
colnames={'obj_state_new'};
data = {num2str(2)};
tablename = 'objects';
whereclause = ['WHERE obj_name = "obj', num2str(n), '"']
update(conn,tablename,colnames,data,whereclause)
end
But all I get is this error:
Error using database/update (line 268) Java exception occurred: java.sql.BatchUpdateException: Batch entry 0 UPDATE objects SET obj_state_new = '2' WHERE obj_name = "obj1" was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2762) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1999) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:421) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2929)
Error in scriptingTest (line 18) update(conn,tablename,colnames,data,whereclause)
I tested the connection and it's OK.
Can someone point me in the right direction?
Thanks in advance