[Webinar] Learn how to a build a cloud-first strategyRegister Now


Specifying DBI ODBC parameters

Posted on 2006-04-19
Medium Priority
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

ID: 16493059
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.


Accepted Solution

tone28 earned 2000 total points
ID: 16494495
Yup, that is it. I ran into that too.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Six Sigma Control Plans
Suggested Courses

865 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