I've got an application where I do the following:

    # Look up last calculated transsum if it exists
    my $rsts = $c->model ('MintAppDB::TransSum')->find ({
                      category => $c->req->param ('category'),
                      sentto => $c->req->param ('sentto'),
                      iso => $c->req->param ('iso')
                    });

sentto contains an url style link, for instance "email:[EMAIL PROTECTED]". Somewhere when generating SQL for this, it becomes:

STH: SELECT me.updated, me.category, me.sentto, me.iso, me.amt FROM mm_transsum me WHERE ( email:[EMAIL PROTECTED] = ? AND me.category = ? )

It seems Postgres gets confused with my usage of a variable with colon in it, and the default quoting being done on strings somewhere in DBD::Pg or DBIx::Class doesn't seem to pursuade Postgres from interpreting the string with the colon in as a special "variable" field (or whatever, I haven't looked to deep into this functionality of Postgres).

I've tried calling "quote" manually and use:

  sentto => \ $myquotedstring

instead, hoping that manually calling quote from the dbh driver from DBD::Pg would take care of it, but no such luck.

The error message being generated by Catalyst/DBIx::Class is:

Cannot mix placeholder styles ":foo" and "?"

Does anybody have an idea how I can pursuade Postgres into accepting this as just a simple string and that Postgres shouldn't try to interpret anything in it?

Thanks,

Marius K.

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to