-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm going to report this as a "for what it's worth" report.  I've 
spent many hours tracking it down, and I finally found a reasonable 
work around, but I haven't been able to create a simple reproducible 
instance of the problem and it may not be worth doing so.  I do have 
one solid question at the bottom though.

I have a database with a "uid" field which consists of simple 
numbers.  This is the primary key, and I use Setup to say so.

         $this->{_set} = DBIx::Recordset->Setup({
                         '!DataSource' => $this->{_db},
                         '!Table' => 'publications',
                         '!PrimKey' => 'uid',
                         });

Of course CSV files aren't typed, so Recordset doesn't know it's an integer.

If I call $$set->Delete({uid => 85}), Recordset will construct an SQL 
command of:
        DELETE WHERE uid = ?
and pass 85 as the value

If I put debug statements in SQL::Statement (the C code) I find that 
the column is a string "85" and the parameter is.... sometimes an 
integer (works) and sometimes a real (doesn't).

I have no idea whatsoever why it's a real. I gave up debugging (it 
gets real messy around the interface the C code) and trying to figure 
out whether it was DBIx::Recordset, DBI::CSV, DBI::File, 
SQL::Statement, SQL::Eval or Statement.xs that was causing the 
problem.  It won't happen in a simple test case, some combination of 
queries sets it up.  I have code in which it always happens, but it's 
complicated.  Whoever it was,  a string comparison of "85" and 
"85.00000" doesn't work real well.

Fortunately, this works:

     my $cnt = $$set->Delete({'#uid' => 85});

Is there a way of setting that up at Setup time instead of every time 
I do a query?
- -- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/
[EMAIL PROTECTED] (or ...!alice!nazgul for time travelers :-)

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Security 7.0.3

iQA/AwUBO/Mk8SZsPfdw+r2CEQLJcQCdGpu4fuG/S+yF49LKm9G4dAHRGMkAnRaH
fsoK+kpTz6Tk4hfceU787jzJ
=FtS2
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to