Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by mpeppler (Vicar)
on Jul 07, 2006 at 15:44 UTC ( #559810=note: print w/replies, xml ) Need Help??


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

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

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

Replies are listed 'Best First'.
Re^4: DBI::Sybase -retrieving BLOB values from ms-sql question
by anexiole (Novice) on Jul 07, 2006 at 22:48 UTC
    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

Re^4: DBI::Sybase -retrieving BLOB values from ms-sql question
by Anonymous Monk on Jul 10, 2006 at 02:20 UTC
    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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2020-12-01 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (6 votes). Check out past polls.

    Notices?