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 » problem with Oracle Database

Post new topic  Reply to topic
 problem with Oracle Database « View previous topic :: View next topic » 
Author Message
kiran_mvr
PostPosted: Mon May 09, 2005 5:25 am    Post subject: problem with Oracle Database Reply with quote

Apprentice

Joined: 12 Dec 2004
Posts: 35

Hai

iam having some problem with getting a value from single column in Oracle database.

Here DIRECTORYPATH is the column name from which iam trying to get the value.TARGET is the table name.

CODE:
Environment.Variables=PASSTHRU('THE(SELECT ITEM T.DIRECTORYPATH FROM Database.TARGET AS T WHERE T.RECEIVER=RECEIVER)');

is this correct statement???
_________________
Kiran_manny
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon May 09, 2005 5:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think Oracle doesn't know the "THE" keyword.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Devasis.Sahu
PostPosted: Mon May 09, 2005 6:01 pm    Post subject: Oracle problem Reply with quote

Apprentice

Joined: 22 Feb 2003
Posts: 43
Location: India

Hello,

You can also give a try by removing the keyword "database" .....PASSTHRU doesnot support the keyword "database"... use the DSN name instead of the keyword.

Further, look at this post. Though it was on DB2, you could give it a try.

http://www.mqseries.net/phpBB2/viewtopic.php?t=21845

Regds
Back to top
View user's profile Send private message Yahoo Messenger
Ian
PostPosted: Tue May 10, 2005 5:22 am    Post subject: Reply with quote

Disciple

Joined: 22 Nov 2002
Posts: 152
Location: London, UK

Firstly, you have confused two different types of syntax here.

The 'THE' and 'ITEM' are WBIMB native ESQL syntax and form part of ESQL to query a database table.
They are not used with the PASSTHRU statement.

PASSTHRU is used to write ESQL statements that
- Bypass the WebSphere Business Integration Message Broker Parser
- Go straight to the configured backend database
- Execute a coded statement

PASSTHRU allows you to use database syntax not normally supported by ESQL, for example the TO_CHAR function in Oracle.


Secondly, you should code your ESQL to cater for multiple rows returned from an SQL SELECT statement.

Environment.Variables.ResultSet[]=PASSTHRU('SELECT...');
_________________
Regards, Ian
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue May 10, 2005 5:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Ian wrote:
Secondly, you should code your ESQL to cater for multiple rows returned from an SQL SELECT statement.

Environment.Variables.ResultSet[]=PASSTHRU('SELECT...');


I'm going to go the other way and suggest
Code:
Set Environment.Variables.DirPath = THE(SELECT ITEM T.DIRECTORYPATH FROM Database.TARGET AS T WHERE T.RECEIVER=RECEIVER);


There's nothing that seems to require PASSTHRU in this.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Ian
PostPosted: Tue May 10, 2005 8:02 am    Post subject: Reply with quote

Disciple

Joined: 22 Nov 2002
Posts: 152
Location: London, UK

I agree with this last suggestion as it is the more elegant solution (for this specific problem).

My second point had been more along the lines that when you require the use of an SQL SELECT statement within a PASSTHRU function then you MUST code it for a returned result set (ie, using the square braces).
_________________
Regards, Ian
Back to top
View user's profile Send private message
kiran_mvr
PostPosted: Tue May 10, 2005 8:47 am    Post subject: Oracle Database Problem Solved Reply with quote

Apprentice

Joined: 12 Dec 2004
Posts: 35

Hai all,

My problem was solved.Actually i am trying to get a column value(DIRECTORYPATH) dynamically with the help of RECEIVER value.


Here for this logic the below code worked.



CODE:

SET Environment.DirPath=THE(SELECT T.DIRECTORYPATH FROM Database.TARGET AS T WHERE T.RECEIVER=RECEIVER);

bye
Kiran
_________________
Kiran_manny
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 » problem with Oracle Database
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.