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

Reply via email to