PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: binding problem
Date: Nov 22 2009 4:13PM

That looks like a freetds problem to me - your data is being truncated at 255 bytes.

I don't really know how freetds implements the placeholder handling - Sybase OpenClient 12.5 or later will allow varchar parameters up to 16k in length.

Michael


On Nov 20, 2009, at 7:15 PM, Alan Humphrey wrote:

> Hi 
> 
> I'm having a problem where text in a varchar column is being silently
> truncated on UPDATE.  The trace below shows what's happening.  The line
> starting "bind :p1" under "prepare_cached" shows the truncated text that
> gets written to the database.  However, the bind :p1 under "execute" shows
> the complete text.
> 
> Additional info - database is MSSQL, code is generated via DBIx::Class,
> connection is made through FreeTDS on a NetBSD system.
> 
> Many thanks for any ideas/insights!
> 
> - Alan 
> 
> UPDATE birding_sites SET site_description = ? WHERE ( id = ? ): 'Bottle
> Beach State Park, a 3/4-mile stretch of waterfront along the south shore of
> the bay of Grays Harbor in the Pacific Northwest Coast ecoregion, is a
> Washington State Important Bird Area. Bottle Beach has an interesting
> history. The site was platted as the town of Ocosta in 1889, when the
> railroad designated Ocosta as their coastal terminus for shipments to the
> Orient and San Francisco. In 1894, when the terminus was relocated in
> Tacoma, Ocosta's population began to dwindle. Today, all that remains of
> this town is a Victorian mansion, pilings of the old dock, and the brick
> foundation of the railroad turntable (still visible along the beach). Horses
> and geese now feed in the fields that once housed the town of Ocosta.', '1'
>     -> prepare_cached for DBD::Sybase::db (DBI::db=HASH(0xbec6b90)~0xbec6b00
> 'UPDATE birding_sites SET site_description = ? WHERE ( id = ? )'
> HASH(0xbff63e0) 3) thr#986e008
>     syb_st_prepare() -> inUse = 0
>     dbd_preparse parameter :p1 ()
>     dbd_preparse parameter :p2 ()
>     dbd_preparse scanned 2 distinct placeholders
>     dyn_prepare: ct_dynamic(CS_PREPARE) for DBD5
>     syb_st_prepare() -> set inUse
> 1   <- prepare= DBI::st=HASH(0xbff7b10) at DBI.pm line 1684 via  at DBI.pm
> line 2240
>     <- prepare_cached= DBI::st=HASH(0xbff7b10) at DBI.pm line 2240 via  at
> DBI.pm line 606
>     -> bind_param for DBD::Sybase::st (DBI::st=HASH(0xbff7b10)~0xbf0cd60 1
> 'Bottle Beach State Park, a 3/4-mile stretch of waterfront along the south
> shore of the bay of Grays Harbor in the Pacific Northwest Coast ecoregion,
> is a Washington State Important Bird Area. Bottle Beach has an interesting
> history. The site was platted as the town of Ocosta in 1889, when the
> railroad designated Ocosta as their coastal terminus for shipments to the
> Orient and San Francisco. In 1894, when the terminus was relocated in
> Tacoma, Ocosta's population began to dwindle. Today, all that remains of
> this town is a Victorian mansion, pilings of the old dock, and the brick
> foundation of the railroad turntable (still visible along the beach). Horses
> and geese now feed in the fields that once housed the town of Ocosta.'
> HASH(0xbff6590)) thr#986e008
> bind :p1 <== 'Bottle Beach State Park, a 3/4-mile stretch of waterfront
> along the south shore of the bay of Grays Harbor in the Pacific Northwest
> Coast ecoregion, is a Washington State Important Bird Area. Bottle B'
> (attribs: HASH(0xbff6590))
>     <- bind_param= 1 at DBI.pm line 1316 via  at DBI.pm line 616
>     -> bind_param for DBD::Sybase::st (DBI::st=HASH(0xbff7b10)~0xbf0cd60 2 1
> HASH(0xbff6590)) thr#986e008
> bind :p2 <== '1' (attribs: HASH(0xbff6590))
>     <- bind_param= 1 at DBI.pm line 1316 via  at DBI.pm line 616
>     -> execute for DBD::Sybase::st (DBI::st=HASH(0xbff7b10)~0xbf0cd60)
> thr#986e008
>        bind :p1 () <== 'Bottle Beach State Park, a 3/4-mile stretch of
> waterfront along the south shore of the bay of Grays Harbor in the Pacific
> Northwest Coast ecoregion, is a Washington State Important Bird Area. Bottle
> Beach has an interesting history. The site was platted as the town of Ocosta
> in 1889, when the railroad designated Ocosta as their coastal terminus for
> shipments to the Orient and San Francisco. In 1894, when the terminus was
> relocated in Tacoma, Ocosta's population began to dwindle. Today, all that
> remains of this town is a Victorian mansion, pilings of the old dock, and
> the brick foundation of the railroad turntable (still visible along the
> beach). Horses and geese now feed in the fields that once housed the town of
> Ocosta.' (size 730/732/0, ptype 8, otype 0)
>        bind :p2 () <== 1 (size 1/4/0, ptype 8, otype 0)
>     cmd_execute() -> ct_send() OK
>     cmd_execute() -> set inUse flag
>     st_next_result() -> ct_results(4047) == 1
>     st_next_result() -> ct_results(4046) == 1
> ct_results(4046) final retcode = -205
>     st_next_result() -> lasterr = 0, lastsev = 0
>     st_next_result() -> got CS_CMD_DONE: resetting ACTIVE, moreResults,
> dyn_execed, exec_done
>     clear_sth_flags() -> resetting ACTIVE, moreResults, dyn_execed,
> exec_done
>     clear_sth_flags() -> reset inUse flag
>     <- execute= -1 at DBI.pm line 1322 via  at DBI.pm line 616
> 
> 
> 

--
Michael Peppler
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html

"A successful [software] tool is one that was used to do something undreamed of by its author." -- S. C. Johnson