Specifying DBI ODBC parameters

Posted on 2006-04-19
Last Modified: 2011-09-20
I have a local DSN setup to access a remote server running a Postgres Database.
Using and ODBC DSN I am getting the following error message from the DBD::ODBC

"DBD::ODBC::st fetchrow_hashref failed:  Fetched item was truncated.  (SQL-01004)
st_fetch/SQLFetch (long truncated DBI attribute LongTruncOK not set and/or LongReadLen too small) err=-1) "

Anyone know how to correct this problem?

Question by:gmanpert

    Author Comment

    Ah, ok, found it.

    PERL DBI manual states:

    "Many databases support BLOB datatypes holding 2,000,000,000 bytes.  To avoid the memory problems LongReadLen defaults to 0 or 80."

    In short, using:

    $dbh = DBI->connect ("DBI:ODBC(LongReadLen=1024):$DSN", $USER, $PWD)
       or die ("Error connecting to database: $DBI::errstr");

    Solved the problem.

    LVL 6

    Accepted Solution

    Yup, that is it. I ran into that too.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now