By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

is it possible to pass 2 SQL statements in a single call ?

P: n/a
Hello all,

Is it possible to pass 2 SQL statements in a single call ?

I keep SQL statements in a text file and usually there are couples of
several SQL statements that represent a named unit of job - for
example declaring a variable and do select using it. Than my java
program find the necessary job unit in a file and pass it to jdbc
driver.

This approach works fine with MS SQL, but I faced troubles to do so
with DB2. I suppose there should be a jdbc driver switch/parameter
that enables compound SQL statements. Can somebody help me?

my example: (it's MS SQL syntax, but the idea is the same)
--- sql-statements.properties --

task_01 = \
declare @event_id int \
set @event_id = ? \
\
select ID from ASSIGNMENTS where EVENT_ID = @event_id \

task_02 = \
...
--
Mike
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DB2
Have you tried with a specific driver for DB2 such as StarSQL for Java
(from StarQuest)?

Bob

ms*****@ariasys.com (mskorik) wrote in message news:<a1**************************@posting.google. com>...
Hello all,

Is it possible to pass 2 SQL statements in a single call ?

I keep SQL statements in a text file and usually there are couples of
several SQL statements that represent a named unit of job - for
example declaring a variable and do select using it. Than my java
program find the necessary job unit in a file and pass it to jdbc
driver.

This approach works fine with MS SQL, but I faced troubles to do so
with DB2. I suppose there should be a jdbc driver switch/parameter
that enables compound SQL statements. Can somebody help me?

my example: (it's MS SQL syntax, but the idea is the same)
--- sql-statements.properties --

task_01 = \
declare @event_id int \
set @event_id = ? \
\
select ID from ASSIGNMENTS where EVENT_ID = @event_id \

task_02 = \
...

Nov 12 '05 #2

P: n/a
Statement.executeBatch() seems to work for you. See the doc on
java.sql package for the version of JDBC API that you are using
http://java.sun.com/docs/index.html

-Eugene
ms*****@ariasys.com (mskorik) wrote in message news:<a1**************************@posting.google. com>...
Hello all,

Is it possible to pass 2 SQL statements in a single call ?

I keep SQL statements in a text file and usually there are couples of
several SQL statements that represent a named unit of job - for
example declaring a variable and do select using it. Than my java
program find the necessary job unit in a file and pass it to jdbc
driver.

This approach works fine with MS SQL, but I faced troubles to do so
with DB2. I suppose there should be a jdbc driver switch/parameter
that enables compound SQL statements. Can somebody help me?

my example: (it's MS SQL syntax, but the idea is the same)
--- sql-statements.properties --

task_01 = \
declare @event_id int \
set @event_id = ? \
\
select ID from ASSIGNMENTS where EVENT_ID = @event_id \

task_02 = \
...

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.