On Mon, 19 Jan 2004, Zhivko Duchev wrote:

> $dbh1=DBI->connect("DBI:Pg:dbname='blobt_test';host='ots-5';port='5432'",'duchev','')
>  
> or die 'err';
>   $sqltext="INSERT INTO delme1 (d) VALUES(?)";
>   $sth1=$dbh1->prepare($sqltext);
> 
>   $tmpstmp='01/02/2004';
>   $sth1->bind_param(1,"$tmpstmp", {pg_type=>DBD::Pg::PG_TIMESTAMP} ); #line12
> 
>   my $rv=$sth1->execute;
>   $sth1->finish;
>   $dbh1->disconnect;
> #-----------------------------        
> 
> table delme1 was created : create table delme3 (d timestamp);
> 
> The error message I receive:
> Cannot bind $1 unknown sql_type 0 at testbinddate.pl line 12.
> 

You can work arounds this by using an other datatype ('varchar' if you
want it quoted, 'int' if you don't). When PG_TIMESTAMP is added to the
list of data types it will probably end up doing the same quoting as a
varchar, so you probably can get away with not giving the pg_type.

Rudy

Reply via email to