[ANSWER] Multiples queries (Bonita ==> Oracle)

1
0
-1

Hello everybody,

I have an oracle g11 connector and I try to do multiples insert in the query like it:

insert into t_j_intervention_int (int_id, act_code, pro_id, int_typecours, int_nbheures) values (int_seq.nextval, 'HA2F2713', 183, 'TP', 38); insert into t_j_intervention_int (int_id, act_code, pro_id, int_typecours, int_nbheures) values (int_seq.nextval, 'HA2F2713', 183, 'CM', 22)

but I have an error: "Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: java.sql.SQLSyntaxErrorException: ORA-00911: invalid character"

The query works before when I was with postgreSQL 9.2 but since the migration I have a problem. Moreover, when I copy the query from the log to the oracle developper tools, it works and insert my 2 lines. Is it possible to do multiple queries in oracle from Bonita?

Thank you for your help. Cheers, Sylvain

2 answers

1
+1
-1
This one is the BEST answer!

Oracle has a problem with the semicolon (;) character however if you must do two inserts at the same time you could try a variation where the Oracle Statement becomes something like:

begin
insert into t_j_intervention_int (int_id, act_code, pro_id, int_typecours, int_nbheures) values     (int_seq.nextval, 'HA2F2713', 183, 'TP', 38); insert into t_j_intervention_int (int_id, act_code, pro_id,     int_typecours, int_nbheures) values (int_seq.nextval, 'HA2F2713', 183, 'CM', 22);
end;

Otherwise most peoples views are don't do it because according to the god-like oracle ; isn't recognised for chaining sql commands

regards

Comments

Submitted by yannick.lombardi on Tue, 05/19/2015 - 12:02

You also can do this :

INSERT INTO t_j_intervention_int (int_id, act_code, pro_id, int_typecours, int_nbheures) VALUES     (int_seq.NEXTVAL, 'HA2F2713', 183, 'TP', 38),(int_seq.NEXTVAL, 'HA2F2713', 183, 'CM', 22)
Submitted by Sean McP on Tue, 05/19/2015 - 12:03

Interesting, never knew that, thanks Yannick.

Submitted by sylvain.bailly on Tue, 05/19/2015 - 13:42

I already try it Yannick but it doesn't works. Perhaps I did a mistake. In Oracle it's ok but not in a Bonita connector.

1
0
-1

Thank you very much Sean McP. It works!

Notifications