I am trying to execute SQLs from perl in two different databases Vertica and Db2. I connect to vertica using ODBC driver and to Db2 using DB2 driver. I connect to one database at a time and try to execute the same sqls in both database. When I connect to vertica first and execute the sql it works perfeclty then I issue the <my database handle>->disconnect. And try to connect to db2 to execute the same sql. But I get an error saying the odbc driver could not find the data source name. I think the perl program uses the same odbc driver to connect to Db2 eventhough I specially mention to use DB2 Driver. At the same time. When I execute the sql in DB2 first . It works perfectly but when I try to connect to vertica I am getting an error from IBM DB2 driver. Perl is not taking the odbc driver mentioned in the connection string. I use the disconnect after executing the sql in a database. MY doubt is there any constraint I have to use only one database driver type. Is there any limitation in perl in resetting the drivers used in perl program. Is there a way in perl to solve the issue.


In reply to Using Two Different Database types in Perl by Anonymous Monk

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.