Yes it's referenced in perldoc DBI, and is available for most if not all
drivers. The reason you were getting the error is because ODBC/MSSQL is set
to fetch a certain amount and will truncate when that many bytes are read,
you can change that by setting the LongReadLen attribute. If you set the
LongReadLen to, for example, 5000 bytes {LongReadLen => 5000} it will
truncate records that are more than 5000 bytes and give error (if error
checking is on) if that happens, you can change that behavior by setting
LongTruncOk => 1 though telling the driver that it is ok to truncate after
the LongReadLen value. You would want to usually set LongReadLen to a
number a little higher that the biggest record you would have, or you can
set to the max size of the whole field, which would I believe be 2M for
Long, so LongReadLen => 2000000 will take care of any future problems.
Thanks for the name complement, Ilya.
Ilya Sterin
-----Original Message-----
From: Ilya Zherebetskiy [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 02, 2001 1:35 PM
To: Sterin, Ilya
Cc: [EMAIL PROTECTED]
Subject: Re: :ODBC & SQL Server 7
Oh hey, that did the trick. Is there a reference of all the
variables that DBD::ODBC has?
Thanks for your prompt response!
Nice first name :)
Ilya
On Sat, 2 Jun 2001 13:13:11 -0400
"Sterin, Ilya" <[EMAIL PROTECTED]> wrote:
> Even if you set LongTruncOk => 1 ???
> Are you fetching from any Long, or LOB fields?
>
> Ilya Sterin
>
> -----Original Message-----
> From: Ilya Zherebetskiy [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 02, 2001 12:47 PM
> To: [EMAIL PROTECTED]
> Subject: DBD::ODBC & SQL Server 7
>
>
> I have a particular problem fetching information:
>
> Server is running Microsoft SQL Server 7, OpenLink DAD
> Server Software, Win NT 4.0
>
> Client is a debian box running odbcsdk drivers (detects
> them
> as iODBC). I successfully connect through the examples,
> and
> successfully retrieve data. I then try to compile the
> DBD::ODBC Package to interact with perl.
>
> The package compiles, however it fails on one test:
>
> t/02simple..........ok 7/14DBD::ODBC::st fetchrow failed:
> [OpenLink][ODBC][Driver]Data was truncated
> (SQL-S1004)(DBD:
> st_fetch/SQLFetch (long truncated) err=1) at t/02simple.t
> line 222.
>
> This is the code where it fails:
> $sth = $dbh->prepare("SELECT A,C FROM
> $ODBCTEST::table_name WHERE A=4");
> if ($sth) {
> $sth->execute();
> eval {
> [Line 222 >>] while (@row =
> $sth->fetchrow()) {
> }
> };
> $rc = 1 unless ($@) ;
> }
>
>
> If i compile with make install, it goes through, however
> all
> commands regarding fetch, fetch_array, fetchrow, etc..
> fail
> with the DATA TRUNCATED Error.
>
> Has anyone seen/run into this? Anyone know how to
> resolve
> this?
>
> Thank you!
>
> --
> Ilya Zherebetskiy
> Senior Brainlink Development
> www.brainlink.com
--
Ilya
Brainlink Development
"But the eyes are blind. One must look with the heart..."