Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Perl / DBI Library / June 2009



Tip: Looking for answers? Try searching our database.

DBD::ODBC SQL-08S01 On Multiple Database Joins

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chase Putans - 30 Jun 2009 20:33 GMT
Finding some odd and intermittent issues with DBD::ODBC when doing
multiple database joins.  If I do a multiple database join as in the SQL
below, and do not have a where clause, or have a where clause and do not
bind values, I get an SQL-08S01: "Read from SQL server failed".  If I
remove one of the joins, it works.  If I do a WHERE 1 = ? and bind a 1,
it works.  This looks to be a bug, but I am unsure if anyone else has
seen this.  For now, I am adding a "WHERE 1 = ?" at the end and binding
a 1 to work around it.  I am using unixODBC 2.2.11 and and DBD::ODBC
1.17 (also tried this with 1.22).  I can post a DBI trace if needed as
well.  Query looks like it runs fine running SQL profiler.  Query as
follows.



SELECT

       srvChkCon_Id, hst_Id,

       HostServiceChecks.hst_Id as host,

       ServiceCheckContacts.hstSrvChk_Id,

       HostServiceChecks.srvChk_Id as scname,

       srvChkCon_ContactId,

       srvChkCon_DayNight,

       otherdb..contact.first_name + ' ' + otherdb..contact.last_name
as name,

       srvChkCon_CallBack

       FROM ServiceCheckContacts

               INNER JOIN HostServiceChecks ON
HostServiceChecks.hstSrvChk_Id = ServiceCheckContacts.hstSrvChk_Id

               LEFT JOIN otherdb..contact ON
otherdb..contact.contact_id = ServiceCheckContacts.srvChkCon_ContactId"



Thanks.



Chase Putans
Martin J. Evans - 30 Jun 2009 22:59 GMT
> Finding some odd and intermittent issues with DBD::ODBC when doing
> multiple database joins.  If I do a multiple database join as in the SQL
[quoted text clipped - 46 lines]
>
>  
Which ODBC Driver are you using?

What is the full error text you are getting?

Can you send me a DBD::ODBC trace at level 15 and a unixODBC trace?

To get a unixODBC trace you need to add

[ODBC]
Trace           = yes
TraceFile               = /tmp/unixodbc.log

to the odbcinst.ini.

Sounds like an ODBC driver problem to me but when we get the traces
we'll know more. Just send them to me as attachments on this list of any
size get stripped.

Martin
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.