Here's what I've found while using the Openlink ODBC driver and DBD::ODBC:

I put copies of .odbc.ini into the ~/ of the user that runs the script. (i.e. - there is a copy in nobody's ~/ if you're running from a web server where nobody is the User)

You must have a copy of udbc.ini in /etc or else it doesn't work. I need to complain to Netrista that the free version from iodbc.org doesn't contain a copy of that.

You must set $ENV{ODBCHOME} to the location of Openlink. This is not the lib directory but the parent Openlink directory.

If you don't define your DBI_DSN, DBI_USER, or DBI_PASS environment variables, you can provide that information on the connect string.

DBI->connect('dbi:ODBC:dsn', 'user', 'pass', {...});

If you're having problems with large strings coming from the database, turn on LongTruncOk in the DBI arguments (i.e. - {LongTruncOk => 1}).

Some general rules about the DBI. Use RaiseError during debug mode. It is great. Use a trace level of 3 if RaiseError is not helpful enough. Before DBI->connect: DBI->trace(3); Get a copy of the cheetah (Programming the Perl DBI).

Good luck, and have fun. :)

Update: Forgot to mention about your $ENV{DBI_DSN} = 'path'. That's not right.

$ENV{DBI_DSN} = 'dbi:ODBC:dsn'; $ENV{DBI_USER} = 'user'; $ENV{DBI_PASS} = 'pass'; $ENV{ODBCHOME} = '/usr/local/openlink';

That will get you further. :)

ALL HAIL BRAK!!!


In reply to Re: $ENV question by PsychoSpunk
in thread $ENV question by radagast

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.