I call a procedure in this way:
CallableStatement delete_procedure = connection.prepareCall("{ call schema.delete( ? ) }");
delete_procedure.setInt(1, id);
delete_procedure.execute();
delete_procedure.close();
connection.close();
when I run the command "delete_procedure.execute()
" running crashes. I do not have exceptions. Why?
this is my function, it work fine:
CREATE OR REPLACE FUNCTION schema.delete(integer)
RETURNS void AS
alter table schema.table disable trigger del_trg;
delete from schema.table where id = $1;
alter table schema.table enable trigger del_trg;
PreparedStatement
and useselect schema.delete(?)
as the SQL query.CallableStatement
is intended for procedures, not functions. – a_horse_with_no_name Aug 27 '13 at 8:40