[Dbix-class] '' != NULL for great sadness

fREW Schmidt frioux at gmail.com
Thu Jul 9 14:22:46 GMT 2009


Hey guys,

So I just ran into this yesterday.  I don't know how I didn't see it
before.  Anyway, if I have a field that is a nullable integer I am told that
'' should automatically be converted to a NULL.  MSSQL does this for me when
I type the query directly into the Management Studio, but it doesn't when I
am using DBIx::Class.  Here is the error I am getting:

DBI Exception: DBD::ODBC::st execute failed: [Microsoft][SQL Native
Client]Invalid character value for cast specification (SQL-22018) [for
Statement "UPDATE QCParts SET fixture_id =3D ? WHERE ( id =3D ? )" with
ParamValues: 1=3D'', 2=3D'001A215A1820000'] at c:/Documents and Settings/fr=
ew/My
Documents/Code/aircraft_ducting/local/lib/DBIx/Class/Schema.pm line
1025fixture_id
should be an integer.  Does anyone know what I can do to fix this issue?

-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20090709/e96=
e94c3/attachment.htm


More information about the DBIx-Class mailing list