Re: binding problem

Michael Peppler <[email protected]> Sun, 22 Nov 2009 17:13:47 +0100
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
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 - Syb=
ase OpenClient 12.5 or later will allow varchar parameters up to 16k in l=
ength.

Michael


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

> Hi =96
>=20
> 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 tha=
t
> gets written to the database.  However, the bind :p1 under "execute" sh=
ows
> the complete text.
>=20
> Additional info - database is MSSQL, code is generated via DBIx::Class,
> connection is made through FreeTDS on a NetBSD system.
>=20
> Many thanks for any ideas/insights!
>=20
> - Alan=20
>=20
> UPDATE birding_sites SET site_description =3D ? WHERE ( id =3D ? ): 'Bo=
ttle
> Beach State Park, a 3/4-mile stretch of waterfront along the south shor=
e 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 t=
he
> Orient and San Francisco. In 1894, when the terminus was relocated in
> Tacoma, Ocosta's population began to dwindle. Today, all that remains o=
f
> this town is a Victorian mansion, pilings of the old dock, and the bric=
k
> foundation of the railroad turntable (still visible along the beach). H=
orses
> and geese now feed in the fields that once housed the town of Ocosta.',=
 '1'
>     -> prepare_cached for DBD::Sybase::db (DBI::db=3DHASH(0xbec6b90)~0x=
bec6b00
> 'UPDATE birding_sites SET site_description =3D ? WHERE ( id =3D ? )'
> HASH(0xbff63e0) 3) thr#986e008
>     syb_st_prepare() -> inUse =3D 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=3D DBI::st=3DHASH(0xbff7b10) at DBI.pm line 1684 via  at=
 DBI.pm
> line 2240
>     <- prepare_cached=3D DBI::st=3DHASH(0xbff7b10) at DBI.pm line 2240 =
via  at
> DBI.pm line 606
>     -> bind_param for DBD::Sybase::st (DBI::st=3DHASH(0xbff7b10)~0xbf0c=
d60 1
> 'Bottle Beach State Park, a 3/4-mile stretch of waterfront along the so=
uth
> shore of the bay of Grays Harbor in the Pacific Northwest Coast ecoregi=
on,
> is a Washington State Important Bird Area. Bottle Beach has an interest=
ing
> history. The site was platted as the town of Ocosta in 1889, when the
> railroad designated Ocosta as their coastal terminus for shipments to t=
he
> Orient and San Francisco. In 1894, when the terminus was relocated in
> Tacoma, Ocosta's population began to dwindle. Today, all that remains o=
f
> this town is a Victorian mansion, pilings of the old dock, and the bric=
k
> foundation of the railroad turntable (still visible along the beach). H=
orses
> and geese now feed in the fields that once housed the town of Ocosta.'
> HASH(0xbff6590)) thr#986e008
> bind :p1 <=3D=3D 'Bottle Beach State Park, a 3/4-mile stretch of waterf=
ront
> along the south shore of the bay of Grays Harbor in the Pacific Northwe=
st
> Coast ecoregion, is a Washington State Important Bird Area. Bottle B'
> (attribs: HASH(0xbff6590))
>     <- bind_param=3D 1 at DBI.pm line 1316 via  at DBI.pm line 616
>     -> bind_param for DBD::Sybase::st (DBI::st=3DHASH(0xbff7b10)~0xbf0c=
d60 2 1
> HASH(0xbff6590)) thr#986e008
> bind :p2 <=3D=3D '1' (attribs: HASH(0xbff6590))
>     <- bind_param=3D 1 at DBI.pm line 1316 via  at DBI.pm line 616
>     -> execute for DBD::Sybase::st (DBI::st=3DHASH(0xbff7b10)~0xbf0cd60=
)
> thr#986e008
>        bind :p1 () <=3D=3D 'Bottle Beach State Park, a 3/4-mile stretch=
 of
> waterfront along the south shore of the bay of Grays Harbor in the Paci=
fic
> Northwest Coast ecoregion, is a Washington State Important Bird Area. B=
ottle
> Beach has an interesting history. The site was platted as the town of O=
costa
> in 1889, when the railroad designated Ocosta as their coastal terminus =
for
> shipments to the Orient and San Francisco. In 1894, when the terminus w=
as
> relocated in Tacoma, Ocosta's population began to dwindle. Today, all t=
hat
> remains of this town is a Victorian mansion, pilings of the old dock, a=
nd
> the brick foundation of the railroad turntable (still visible along the
> beach). Horses and geese now feed in the fields that once housed the to=
wn of
> Ocosta.' (size 730/732/0, ptype 8, otype 0)
>        bind :p2 () <=3D=3D 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) =3D=3D 1
>     st_next_result() -> ct_results(4046) =3D=3D 1
> ct_results(4046) final retcode =3D -205
>     st_next_result() -> lasterr =3D 0, lastsev =3D 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=3D -1 at DBI.pm line 1322 via  at DBI.pm line 616
>=20
>=20
>=20

--
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 undrea=
med of by its author." -- S. C. Johnson  =20