ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Use of CURSORs in passthru

Post new topic  Reply to topic
 Use of CURSORs in passthru « View previous topic :: View next topic » 
Author Message
mmarq
PostPosted: Tue Oct 01, 2002 8:01 am    Post subject: Use of CURSORs in passthru Reply with quote

Acolyte

Joined: 19 Sep 2002
Posts: 74
Location: Newton, MA

I've got the following SQL to get through a passthru statement:

DECLARE c1 CURSOR WITH HOLD FOR
SELECT seed_value
FROM sequence_table
WHERE client_column_name = 'abp_unq_id'
FOR UPDATE OF seed_value;


OPEN c1;
FETCH c1 INTO v_seed_value;
UPDATE sequence_table
SET seed_value = (v_seed_value + 1)
WHERE client_column_name = 'abp_unq_id';
CLOSE c1;

I've placed the first part (first ; ends the first part) into a passthru statement and I get the following in the exception list:

IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token
"DECLARE c1 CURSOR WITH HOLD FOR" was found following "BEGIN-OF-STATEMENT".
Expected tokens may include: "<space>". SQLSTATE=42601

Can anyone think of a way for me to run this SQL?

Thanks,
M
_________________
M Marquis
Back to top
View user's profile Send private message Visit poster's website AIM Address
Miriam Kaestner
PostPosted: Fri Oct 04, 2002 3:48 am    Post subject: Reply with quote

Centurion

Joined: 26 Jun 2001
Posts: 103
Location: IBM IT Education Services, Germany

I think you can only PASSTHRU one single statement. You are trying to perform a series of statements. This should work with Stored Procedures of the database. You can execute these stored procs via PASSTHRU, or by creating a user-defined external procedure in ESQL
(CREATE PROCEDURE ...)
Back to top
View user's profile Send private message Send e-mail
mmarq
PostPosted: Fri Oct 04, 2002 5:58 am    Post subject: Passthru Reply with quote

Acolyte

Joined: 19 Sep 2002
Posts: 74
Location: Newton, MA

Thanks Miriam, you are right. We have tried numerous configurations with the passthru and now are resorting to a stored procedure to do the job.

Thanks for the reply!
-Melissa
_________________
M Marquis
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Use of CURSORs in passthru
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.