Up Prev Next
From: Emmanuel Quevillon <tuco at pasteur dot fr>
Subject: Error thrown when trying to update a 'text' field
Date: Aug 28 2009 2:16PM
I didn't know to which mailing list I should send this message, so
I'm cc'ing to DBIx::Class as it uses this framework. However, the DB
is Sybase 12.5.3.
The thing is that I want to do a large update of a certain amount of
rows. What I've to do is replace some kind of a date string into a
text field. If I send the query generated by DBIx::Class by hand to
the server, it works perfectly and to the update.
However, if I let the perl code (DBIC) doing it itself, I get the
following error thrown by Sybase:
DBI Exception: DBD::Sybase::db prepare failed: Server message
number=2782 severity=16 state=1 line=1 server=CRBIPTEST
procedure=DBD2 text=An untyped variable in the PREPARE statement
'DBD2' is being resolved to a TEXT or IMAGE type. This is illegal in
a dynamic PREPARE statement.
[for Statement "UPDATE produit SET HISTORIQUE = ? WHERE (
CODE_PRODUIT_CRBIP = ? )"] at
/usr/local/lib/perl5/site_perl/5.8.8/DBIx/Class/Schema.pm line 1025
Here is the request generated:
UPDATE produit SET HISTORIQUE = ? WHERE ( CODE_PRODUIT_CRBIP = ? ):
'1993 R. Landen
1993 - 1998 M.M. Lecadet IP
1998 - 2001 B. Papierok IP
2001 - 2008 J.F. Charles IP
2009 C. Bizet IP', 'CRBIPbIEBC1048'
So I though the problem could come from the fact that the text field
contains some carriage return and causes Sybase not to understand
correctly the request?
On colleague also told me it could come from the fact that DBI
treats text field as BLOB????? Never head of this.
If someone could light my lantern.....
Thanks in advance
Biological Software and Databases Group
+33 1 44 38 95 98
tuco at_ pasteur dot fr