is it posible to send multiple DB updates in single request

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
rutabuga
Posts: 4
Joined: 06 Jun 2011, 18:50

is it posible to send multiple DB updates in single request

Post by rutabuga »

I'm currently looking for the best way to do an insert into on multiple
un-related tables. say for example

INSERT INTO `tbl1` (`name`) VALUES ('MR x');
INSERT INTO `tbl2` (`a number`) VALUES ('1337');

without having to do multiple calls of dbManager.executeUpdate()
is there a way to send multiple sql updates without the use of loop.
and therefore in a single request to the DB vs many requests

something like

dmManager.executeUpdate(update1 + update2 + update3)
trueicecold
Posts: 84
Joined: 11 Oct 2009, 11:46
Contact:

Post by trueicecold »

You could create a stored procedure to hold all of the inserts you need, and with 1 call to the db - run it. However, in the background the database will still run multiple insert queries.
Post Reply