Jeff Thies wrote:

>   This is an update to a previous SQL error post. The problem is in the
> placeholders.
>
> This fails:
>
> my $sql=q{INSERT INTO some_table(some_field) values(?)};
> my $sth=$dbh->prepare($sql);
> $sth->execute('some variable with a colon: in it');
>
> This is OK:
> my $sql=q{INSERT INTO some_table(some_field) values('some variable with
> a colon: in it')};
> my $sth=$dbh->prepare($sql);
> $sth->execute();
>
> as does a command line insert.
>
> There seems to be a problem with the placeholder. I don't recall having
> a problem like this before, so I suspect a DBI update by my webhost.
>
> How do I retrieve the DBI version?
>

print $DBI::VERSION;

I wonder if there's a stray $ in your original SQL statement, so the
statement does not actually have a placeholder but does contain the
expanded date value.   I'm not convinced by this; your post uses q{...}
which suppresses variable expansion. You don't indicate the DBMS you're
using, which doesn't help us.

--
Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED])
Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/
#include <disclaimer.h>


Reply via email to