Hello --

I'm working with a SQL Server 2000 database. One of the columns is of type 
'money'. 

I've come to understand the issue I have originates with DBI placeholders which 
cause an error about not automagically converting the datatype. (Changing the 
datatype isn't an option, something to do with MSAccess.) 

The same problem exists with both DBD::ODBC and DBD::Sybase. I'm using FreeTDS 
and unixODBC to connect to SQL Server.

Anyway, running the query with no placeholder works fine, but then the query 
has to be prepared each time... And, of course, all DBIx-Class functions fail 
when I have to query this 'money' field, because it uses placeholders.

So, I've discoverd this hack to the SQL, which works:
                                            |||||||||||||||||||||||||||
my $q = q/select * from DATA where convert(float, "Total Cost")=? order by 
"Invoice #"/;
my $sth=$dbh->prepare($q);
$sth->execute(230.03);

My question is, where would I indicate that 'convert()' stuff in DBIx::Class 
setup for that accessor? Is this possible? I know I can get the sth($q) from 
DBIC, but I think that leaves me without magic accessors, right?

Any clue appreciated, I'm obviously lacking a bit. :-/

Cheers,

-- 
Michael Higgins <[EMAIL PROTECTED]>

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to