Hi Monks

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?


In reply to Colon in server name breaks FreeTDS by dbmathis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.