Skip to Content.
Sympa Menu

freetds - Re: [freetds] Fwd: [unixODBC-support] PHP PDO unixODBC FreeTDS SQL Server text column size

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jochen Daum <jd AT automatem.co.nz>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Fwd: [unixODBC-support] PHP PDO unixODBC FreeTDS SQL Server text column size
  • Date: Wed, 26 Sep 2012 09:31:08 +1200

Thanks:

>> > To determine if the FreeTDS ODBC driver is able to process your
>> > query results, I recommend testing it with bsqlodbc. If that
>> > works, you can have some confidence that the driver works as
>> > expected. That is, as the authors intended.
>>
>> When I run this query through bsqlodbc
>>
>> select [Attachment].[attaContent] from [Attachment] where
>> ([Attachment].[attaId] = 10239)
>>
>> I get bsqlodbc: error -2: SQLAllocHandle: invalid handle: failed
>
> Well, we can file that under "doesn't work". Did you get no other
> message before that one? Usually a TDS_DONE_ERROR from the server is
> preceded by a message, and something like "invalid handle" would occur
> later, after the program continues blithely on. That's "usually" as
> in, I've never seen an exception.
>
>> column_size = 2147483647 (2147483647 on server)
>
> Does it help if you "set textsize 10000000" (10 million) first? The
> constraint in your configuration file
>

I can't see any other error message, but admittedly this is the first
time I log at freetds logs. I've modified my query to:

set textsize 10000000
select attaRefTable from [Attachment] where ([Attachment].[attaId] = 10239)

- I tried "go" inbetween the 2 statements and it threw an error
- attaRefTable is a varchar(30)

>> text size = 10971520
>
> might not matter; you said its name is "/etc/freetds/freetds.ini" and
> that would normally be /etc/freetds/freetds.conf.

That was a mixup by myself. its /etc/freetds/freetds.conf

I also found that I used tds version = 8.0, which doesn't exist, so I
changed this to 7.2.

In summary:

bsqlodbc -v -Uwebsite -Ppassword -SEIS -DExportInformationSystem -o
output -e error -i Attachment.sql

returns

output: empty
error:
bsqlodbc:273: Verbose operation enabled
bsqlodbc:366: Query:
set textsize 10000000
select attaRefTable from [Attachment] where ([Attachment].[attaId] =
10239)
Metadata
col name type value type name
size varies
------ ------------------------------ ---------- ------------------
------ ------
bsqlodbc: error -2: SQLAllocHandle: invalid handle: failed

freetds.log attached.

Thanks for any further pointers.









>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds



--
P.S.: Latest newsletter: Website application reporting - an overview -
http://eepurl.com/pKrAD

Kind Regards,

Jochen Daum

"There is no shortcut to anywhere worth going" - Beverly Sills

Automatem Ltd
Phone: +64 9 630 3425
Mobile: +64 21 567 853
Email: jd AT automatem.co.nz
Website: www.automatem.co.nz
Skype: jochendaum
http://nz.linkedin.com/in/automatem
http://twitter.com/automatem

Attachment: freetds.log
Description: Binary data




Archive powered by MHonArc 2.6.24.

Top of Page