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 » error while accessing sql server database

Post new topic  Reply to topic
 error while accessing sql server database « View previous topic :: View next topic » 
Author Message
rkford11
PostPosted: Thu Mar 23, 2006 3:36 pm    Post subject: error while accessing sql server database Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

Our Environment
windows 2003
WBIMB 6.0
WMQ 6.0

I am accessing SQL server database and when i test the ODBC connection it works fine.
But when i deploy the message flow on to the broker and input a message to extract the data it gives me the following error

Database error: SQL State ''42000''; Native Error Code '8180'; Error Text ''[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.''.

The error has the following diagnostic information: SQL State ''42000''SQL Native Error Code '8180' SQL Error Text ''[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.''

Please guide me through this.

Thanks
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Thu Mar 23, 2006 8:27 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi rkford11,

http://support.microsoft.com/kb/825019

This is not exactly an MB issue I think....you should try posting it into some DB forums also.

Regards.
Back to top
View user's profile Send private message Send e-mail
dsriksha
PostPosted: Fri Mar 24, 2006 6:01 am    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

Hi RKFORD11

are you using any database update or insert in your flows?
Back to top
View user's profile Send private message Send e-mail
sarat
PostPosted: Fri Mar 24, 2006 8:08 am    Post subject: Reply with quote

Centurion

Joined: 29 Jun 2005
Posts: 136
Location: India

Hi rkford11,

First try to hit the database with some sample java program. I mean check whether you are able to interact with data base or not. Le me know successful
_________________
With Regards,
Sarat.
Back to top
View user's profile Send private message
JT
PostPosted: Fri Mar 24, 2006 8:32 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Post the SQL statement that produces the error.
Back to top
View user's profile Send private message
rkford11
PostPosted: Fri Mar 24, 2006 8:43 am    Post subject: Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

JT wrote:
Post the SQL statement that produces the error.


I am able to interact with the database on the server from query analyzer on my desktop and also thru TOAD

This is my statement
SET OutputRoot.XML.Data[] = SELECT * FROM Database.dbo.AppTable AS AB WHERE AB.ID ='376ADZ6D';

FYI it's
SQL Server version 2000 service pack 3a

Thanks
Back to top
View user's profile Send private message
dsriksha
PostPosted: Fri Mar 24, 2006 9:04 am    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

This is my statement
SET OutputRoot.XML.Data[] = SELECT * FROM Database.dbo.AppTable AS AB WHERE AB.ID ='376ADZ6D';


Thanks[/quote]

Hi Rkford11 kindly try your esql statement like this
SELECT AB.* FROM Database.dbo.AppTable AS AB WHERE AB.ID ='376ADZ6D';


And What is dbo is it part of table name
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Sat Mar 25, 2006 6:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

dsriksha wrote:
Hi Rkford11 kindly try your esql statement like this
SELECT AB.* FROM Database.dbo.AppTable AS AB WHERE AB.ID ='376ADZ6D';


Actually, the whole statement should be
Code:
SET OutputRoot.XML.Data[] = (SELECT AB.* FROM Database.dbo.AppTable AS AB WHERE AB.ID ='376ADZ6D');


And I'd assume that dbo is the schema name, for the database owner on SQLServer.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mgk
PostPosted: Sat Mar 25, 2006 7:43 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

In V6, the ( ) around a SELECT are not required (but it is not a problem to use them). Also, the single * does work for a SELECT in the select list, so in this case the original statement as posted looks correct to me. dbo on SQLServer is indeed the schema the table is supposed to be in (the default schema name). I would make sure that the permissions were correct for the broker DB user to access that table (and that the table is in the schema dbo).

Also it would be useful to know what version of SQL server you are using, and if the DB is local or remote. In addition, are you using SQLServer or Windows Authentication (as you must use SQLServer auth).


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
rkford11
PostPosted: Wed Mar 29, 2006 9:20 am    Post subject: Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

The space character in the column name of the table is the culprit of the issue.
columns were defined as Column One, Column Two, Column Three
I modified my statement to
SET OutputRoot.XML.DATA = SELECT AB."Column One" FROM Database.dbo.AppTable AS AB WHERE AB.ID='376ADZ6D';

but it still throws me the same error.
Please advice me whether it is possible for the broker( SQL Driver) to extract data when the column names are defined with space character in between.

Thanks
Back to top
View user's profile Send private message
dsriksha
PostPosted: Wed Mar 29, 2006 12:08 pm    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

rkford11 wrote:
The space character in the column name of the table is the culprit of the issue.
columns were defined as Column One, Column Two, Column Three
I modified my statement to
SET OutputRoot.XML.DATA = SELECT AB."Column One" FROM Database.dbo.AppTable AS AB WHERE AB.ID='376ADZ6D';

but it still throws me the same error.
Please advice me whether it is possible for the broker( SQL Driver) to extract data when the column names are defined with space character in between.

Thanks

This may work.....
Set your column name to a variable like this.

Set Environment.variable= 'column||null||name';

Then use EVAL function.

Enjoy
Back to top
View user's profile Send private message Send e-mail
JT
PostPosted: Wed Mar 29, 2006 12:38 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

First, configure your SQL statement so that it executes properly from the database command-line, then take that statement and wrap it with PASSTHRU. For example:

Code:
SET OutputRoot.XML.DATA = PASSTHRU('SELECT AB."Column One" FROM Database.dbo.AppTable AS AB WHERE AB.ID=?','376ADZ6D');
Back to top
View user's profile Send private message
klabran
PostPosted: Thu Mar 30, 2006 7:23 am    Post subject: Reply with quote

Master

Joined: 19 Feb 2004
Posts: 259
Location: Flagstaff AZ

If this is still an issue with the column names then add an alias to your column names in the select statement or create a stored procedure that aliases the column names on return. The alias will be what is returned in both these cases.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » error while accessing sql server 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.