Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: DBI::Sybase -retrieving BLOB values from ms-sql question

by derby (Abbot)
on Jul 07, 2006 at 13:26 UTC ( [id://559788]=note: print w/replies, xml ) Need Help??


in reply to Re: DBI::Sybase -retrieving BLOB values from ms-sql question
in thread DBI::Sybase -retrieving BLOB values from ms-sql question

That's what I was thinking too but looking at the docs for DBD::Sybase:

Note that LongReadLen has no effect when using DBD::Sybase with an MS-SQL server.

And further on:

Sybase defaults the TEXTSIZE attribute (aka LongReadLen) to 32k, but MS-SQL 7 doesn't seem to do that correctly, resulting in very large memory requests when querying tables with TEXT/IMAGE data columns. The work-around is to set TEXTSIZE to some decent value via $dbh->{LongReadLen} (if that works - I haven't had any confirmation that it does) or via $dbh->do("set textsize <somesize>");

So I think the $dbh->do( "set textsize <somesize>" ) may be your only option -- but luckily mpeppler is a monk and he'll probably be along soon enough with a better answer.

-derby
  • Comment on Re^2: DBI::Sybase -retrieving BLOB values from ms-sql question

Replies are listed 'Best First'.
Re^3: DBI::Sybase -retrieving BLOB values from ms-sql question
by mpeppler (Vicar) on Jul 07, 2006 at 15:44 UTC
    You are correct - the OP needs to call $dbh->do("set textsize somevalue"); to get things to work.

    The reason for this is that when $dbh->{longReadLen} is updated DBD::Sybase calls a Sybase API call under the cover, and this API call is not one that is compatible between MS-SQL and Sybase.

    Michael

      i've just found this online
      String Data Handling (from http://search.cpan.org/~mewp/DBD-Sybase/d +bd-sybase.pod) DBD::Sybase supports CHAR/VARCHAR/BINARY/VARBINARY, limited to 255 cha +racters in length up to version 12.0x. As of 12.5 these datatypes can + be up to 16K in size - but supporting the larger sizes requires that + Open Client 12.5 or later be used. Note that the CHAR type is fixed +length (blank padded). Sybase automatically converts CHAR and VARCHAR data between the charac +ter set of the server (see the syscharset system table) and the chara +cter set of the client, defined by the locale setting of the client. +The BINARY and VARBINARY types are not converted. UTF-8 is supported. See the OpenClient International Developer's Guide in the Sybase OpenC +lient manuals for more on character set issues. Strings can be concatenated using the + SQL operator.
      it sort of implies that the limitation is stuck at fetching a max of 255 character per blob. Am I wrong(i hope so)?

      Edit: pre tags replaced with code tags

        The limitation that is referred to here is for char/varchar data, not for blobs. DBD::Sybase has always supported the full blob size (2GB) either via the longReadLen attribute, or via the "set textsize" T-SQL command.

        Also note that the documentation that you are referring to is primarily aimed at DBD::Sybase built with the Sybase OpenClient libraries. You are using it with FreeTDS, which means that some of the behavior is different, and you should refer to the FreeTDS documentation for additional information.

        Michael

      hello michael i have tried using $source_dbh->do("set textsize 40000"); before the prepare statement and it doesn't work... please help:) thank you. gordon
        I don't know all that much about the issues with DBD::Sybase & MS-SQL, but I can try to help.

        The most likely problem is that you are for some reason opening more than one connection. This can happen if DBD::Sybase thinks that the connection is still active when prepare() is called. You can set the syb_no_child_con connection attribute to TRUE and this will inhibit multiple connections for simultaneous statement handles.

        You can also enable the DBI->trace() to see what really happens under the covers.

        Michael

Re^3: DBI::Sybase -retrieving BLOB values from ms-sql question
by imp (Priest) on Jul 07, 2006 at 14:13 UTC
      hi there
      whereabts do you set the 'textsize' for freetds?
        I think it's in the freetds.conf file - you should check the FreeTDS documentation for more information (or ask on the FreeTDS mailing list).

        Michael

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://559788]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-23 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found