On Thu, 9 Aug 2007 13:58:25 +0100
Matt S Trout <[EMAIL PROTECTED]> wrote:

> On Wed, Aug 08, 2007 at 10:06:01AM -0700, Michael Higgins wrote:
> > 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.) 
> 
> If you bound it as the appropriate type, would it work?

Unless there is some magic *other* than importing :sql_types and using 
bind_param on my $statement_handle... no. Is this what you refer to?

If I understand at all what is going on, it is having the placeholder for that 
field when the $sth is 'prepared' -- that is the problem. It appears the 
solution is the convert statement must be _in_ the SQL when the SQL is parsed 
by the (driver? server?) and the statement handle is created.

So, can I use DBIx::Class to get that 'convert' function mapped onto an 
accessor when I create the files for the schema? Or can I make a custom 
resultset (or something) to do the same, but still use $result->accessor 
functions? 

Anyway, it'd be nice if there was a standard workaround to the error (here's 
the text):

DBD::Sybase::db prepare failed: Server message number=260 severity=16 state=1 
line=1 server=SERVER text=Disallowed implicit conversion from data type varchar 
to data type money, table 'DB.dbo.DATA', column 'Total Cost'. Use the CONVERT 
function to run this query.Server message number=8180 severity=16 state=1 
line=1 server=SERVER procedure=sp_prepare text=Statement(s) could not be 
prepared. at test_syb.pl line 20.

Thanks,

-- 
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