473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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

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
2 2097
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: markus | last post by:
This string does not work in php: $sql="UPDATE mytable SET myfield=myuserfunction(myfield)" What I want is my function to evaluate each field and put the new value in the field. For...
5
by: malcolm | last post by:
Example, suppose you have these 2 tables (NOTE: My example is totally different, but I'm simply trying to setup the a simpler version, so excuse the bad design; not the point here) CarsSold {...
4
by: Mike | last post by:
Related to another topic I just posted, I wanted to discuss ways to optimize the validation of very large (>100MB) XML documents. First, I have no idea if something like this already exists; it...
4
by: mangi03 | last post by:
Hi, I came acrosss g++ compile errors whenever I make a function call by reference and found out from the test program that compiler is treating the function argument differently when another...
38
by: Radde | last post by:
HI all, Whats the difference b/w pass by ref and pass by pointer in C++ when ur passing objects as args.. Cheers..
1
by: Clinton Pierce | last post by:
I've got a class that I want to access remotely. The touble is, I can't figure out how to call the constructor of the class with arguments -- and the arguments are necessary to initialize the...
3
by: Brett | last post by:
I have several classes that create arrays of data and have certain properties. Call them A thru D classes, which means there are four. I can call certain methods in each class and get back an...
8
by: Daniel | last post by:
Hi, Does anyone know if it is possible to put an aspx page inside of another? OR run an aspx page and capture the output as a string and then write this out to a page.... So for example say...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.