dbmathis has asked for the wisdom of the Perl Monks concerning the following question:
How can I get around this? I run this same code on the Sybase drive and it works, but with ODBC / FreeTDS it fails with this error:
[Tue Jun 23 18:03:55 2009] [error] [client 10.4.3.5] DBD::ODBC::db pre +pare failed: [FreeTDS][SQL Server]Statement(s) could not be prepared. + (SQL-42000), referer: http://support.hidden.com/cgi-bin/transpose-qq +s.cgi [Tue Jun 23 18:03:55 2009] [error] [client 10.4.3.5] [FreeTDS][SQL Ser +ver]Could not find server 'DC?' in sys.servers. Verify that the corre +ct server name was specified. If necessary, execute the stored proced +ure sp_addlinkedserver to add the server to sys.servers. (SQL-42000) +at /var/www/cgi-bin/transpose-qqs.cgi line 329., referer: http://supp +ort.hidden.com/cgi-bin/transpose-qqs.cgi [Tue Jun 23 18:03:55 2009] [error] [client 10.4.3.5] Can't call method + "execute" on an undefined value at /var/www/cgi-bin/transpose-qqs.cg +i line 338., referer: http://support.hidden.com/cgi-bin/transpose-qqs +.cgi
my $db11 = "DC:server1"; my $dbor = "DC:server2"; FROM openquery([$db11], N\' SELECT r.ReqID , de.varc_EmploymentPriority , d.candidateid , d.FirstName + \'\' \'\' + d.LastName , r.sHiringManager , d.DossierType \') as hc join openquery([$dbor], N\' SELECT p.first_name , p.last_name , c.id , replace(replace(dbms_lob.substr(a.answer,4000,1),chr(10) +, \'\' \'\'),chr(13), \'\' \'\') as "Answer" , replace(replace(dbms_lob.substr(ql.question,4000,1),chr( +10), \'\' \'\'),chr(13), \'\' \'\') as "Question" , CASE ql.type
I an going to try to add the servers to the sys.server group without the colon, but is there a way I can change the code and make this work?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Colon in server name breaks DBD::ODBC
by mje (Curate) on Jun 24, 2009 at 10:34 UTC | |
by dbmathis (Scribe) on Jun 24, 2009 at 13:48 UTC | |
by roboticus (Chancellor) on Jun 25, 2009 at 16:15 UTC | |
by mje (Curate) on Jun 26, 2009 at 07:31 UTC | |
by dbmathis (Scribe) on Jul 04, 2009 at 15:40 UTC |