cancel
Showing results for 
Search instead for 
Did you mean: 

Using more than 1 insert into statement at the same time (MaxDB)

Former Member
0 Kudos

Hi,

I must use more than one Insert Into Statement at the same time.

What must it be placed between Insert Into statements?

String x = "Insert Into(...) Values(...)? Insert Into(....) Values(.....)";

What must be replaced with "?" ?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

String x = "Insert Into(...) Values(...)? Insert Into(....) Values(.....)";

STRING ???

You are kidding are you?

What programming language are you using here?

And what exactly is your requirement?

Running multiple INSERTs in a single transaction?

To do that, just open a connection with autocommit off,

prepare and execute all your INSERT-Statements

(you'll want to use BIND variables and not STRING concatenation for that. Ever heard of SQL injection?),

and finally you commit or rollback your transaction.

Voilá.

regards,

Lars

Former Member
0 Kudos

Hi,

I'm using java.

I only sent sql string.

Normaly i must create connection and command object in java.

I nedd to know how to use more than one sql command at the same time.

For MaxDB, what must be the sql string?

Thanks.

Former Member
0 Kudos

Yes,

I want to know

Running multiple INSERTs in a single transaction

Thanks.

alexander_schroeder
Participant
0 Kudos

Hello Cemil,

While some database management systems have such a feature (e.g. by using a ';'), MaxDB hasn't.

You can use the

addBatch

/

executeBatch

methods to do more than one action in one call.

Regards

Alexander Schröder

Former Member
0 Kudos

Hi,

can you give me an example of Insert Into statement.

How can you prepare 3 insert into stamements executing consequntly?

Thanks.