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 » switching tables using esql

Post new topic  Reply to topic
 switching tables using esql « View previous topic :: View next topic » 
Author Message
Rockon
PostPosted: Wed Dec 07, 2005 7:53 am    Post subject: switching tables using esql Reply with quote

Apprentice

Joined: 24 May 2004
Posts: 43

Hi,
Just curious to find out if we can switch across tables in a single query statement in a Compute Node.
example:
Set Environemnt.Variables.getv_id=THE(......) the sql statement being
Code:
SELECT MIN(A.V_ID) FROM schemaA.tableXX N
WHERE N.PART_NUMBER = '9999'
AND N.VENDOR_ID = 'ABC9999'
 exception
  when no_data_found then
SELECT MIN(A.V_ID) FROM schemaA.tableYY M
WHERE M.PART_NUMBER = '9999'
AND M.VENDOR_ID = 'ABC9999'


The alternate method would ofcourse be to catch it as an exception using the SQLCODE value.

FYI "If PL/SQL raises the NO_DATA_FOUND exception, then SQLCODE returns a value of +100"

Thankyou,
Cheers
Back to top
View user's profile Send private message
shrek
PostPosted: Wed Dec 07, 2005 9:03 am    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2005
Posts: 61
Location: Gudivada,India

One other way of doing it is executing the two SQL with in a COALESCE.

Code:
 Set Environemnt.Variables.getv_id = COALESCE(SQL1, SQL2);
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 » switching tables using esql
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.