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 » Accesing data from DB2.

Post new topic  Reply to topic
 Accesing data from DB2. « View previous topic :: View next topic » 
Author Message
tom_hanks
PostPosted: Mon May 22, 2006 8:08 pm    Post subject: Accesing data from DB2. Reply with quote

Apprentice

Joined: 19 May 2006
Posts: 32

Hai Everybody,

I am getting some error while accessing data from DB2.

If I use,

SET OutputRoot.XML.Head1.Head2 = PASSTHRU('SELECT col1 FROM SCHEMA.TABLE')

it is working fine. But If I use,

SET OutputRoot.XML.Head1.Head2 = PASSTHRU('SELECT col1 FROM SCHEMA.TABLE WHERE col2 = ?','abcd')

I am getting error like this.
IM001 -[Microsoft][ODBC Driver Manager] Driver does not support this function.

What happened to WHERE clause. Experts help me.

thanks in advance.
-Tom[/i]
Back to top
View user's profile Send private message
pottas
PostPosted: Mon May 22, 2006 9:53 pm    Post subject: Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

Tom,

I found this link to the error you're getting:
http://www.easysoft.com/developer/interfaces/odbc/sqlstate_status_return_codes.html#IM001
...and it suggests that it's got something to do it with your ODBC connection.
Test your ODBC connection by trying to connect from your ODBC set-up.
Make sure you have the correct ODBC source in your 'Data Source' property in your Compute Node.

...and this is exactly how to use the passthru as in the online manual:
Quote:

Example
The following example performs a SELECT on table "Table1" in schema "Schema1" in database DSN1, passing two parameters to the WHERE clause and asking for the result set to be ordered in ascending name order. The result set is assigned to the SelectResult folder:
SET OutputRoot.XML.Data.SelectResult.Row[] =
PASSTHRU('SELECT R.* FROM Schema1.Table1 AS R WHERE R.Name = ? OR R.Name =
? ORDER BY Name'
TO Database.DSN1
VALUES ('Name1', 'Name4'));


...and some links to other posts on this site:
http://www.mqseries.net/phpBB2/viewtopic.php?t=28436&highlight=passthru

http://www.mqseries.net/phpBB2/viewtopic.php?t=28131&highlight=passthru+odbc+select

Hope it helps...
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue May 23, 2006 4:40 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You don't seem to be using the right ODBC driver, I think.

You don't need to use Passthru for either of the Select statements that you posted. Using ESQL Select will be more efficient.
_________________
I am *not* the model of the modern major general.
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 » Accesing data from DB2.
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.