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 » Validating updated row

Post new topic  Reply to topic
 Validating updated row « View previous topic :: View next topic » 
Author Message
KrotaZ
PostPosted: Wed Jun 22, 2011 3:46 pm    Post subject: Validating updated row Reply with quote

Novice

Joined: 30 Mar 2011
Posts: 11

Hi.

I've a the need to check if an update statement (using PASSTHRU) has updated any row when executed. I don't need to know how many rows were updated, I just need to know if any row was updated. SQLCODE, SQLSTATE doesn't help.

I'm using Broker 7 with db2 9.7, sql 2k8 and oracle 10g

thanks in advance
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jun 23, 2011 3:43 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I'm not an expert in database stuff, but I wonder whether you need to wrap your UPDATE query in a stored procedure, and return an error code to message broker. Presumably the stored procedure would be able to find out whether any rows were updated easily enough.
Back to top
View user's profile Send private message
KrotaZ
PostPosted: Thu Jun 23, 2011 6:26 am    Post subject: Reply with quote

Novice

Joined: 30 Mar 2011
Posts: 11

@kimbert: Thanks for your reply. As you say an SP es a good way of having the work done, but I just want t know if there's a "broker native way" of solving my problem. Sadly it seems there's no "native way" of doing it so I guees I'll have to use an SP.

Thanks again.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jun 23, 2011 6:28 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Can you turn around and reselect on the data you updated?
Back to top
View user's profile Send private message
KrotaZ
PostPosted: Thu Jun 23, 2011 6:33 am    Post subject: Reply with quote

Novice

Joined: 30 Mar 2011
Posts: 11

jeff: it's kind of hard to do that, I've nearly 6,000,000 of registers to process (daily registers) as you guess that will be a serious overhead to the database.

Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jun 23, 2011 6:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I thought that usually database Update statements did end up returning the number of rows affected.

Are you not capturing the results of your passthru?

Code:
 rows = PASSTHRU(....);
Back to top
View user's profile Send private message
KrotaZ
PostPosted: Thu Jun 23, 2011 7:04 am    Post subject: Reply with quote

Novice

Joined: 30 Mar 2011
Posts: 11

I've tried jeff's idea but with pain in my heart I've to say that doesn't work either. With this code:

Code:
SET Environment.Variables.respass = PASSTHRU ('UPDATE Fernando.DDD AS T SET DDDD = 666 WHERE T.DDDD = 123' TO Database.AJUA);


the database is updated but at the end of the road respass doesn't even exist.

any other idea?? By the way. Thanks jeff for your idea.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Validating updated row
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.