if you are trying to modify records that already exist you need to use
UPDATE instead.

insert is for adding new records, in which case the WHERE portion of the
statement is not applicable.

On Mon, 9 Jul 2001, Daniel Falkenberg wrote:

> List,
> 
> Below is my sub where I want to INSERT the following values into a
> PostgreSQL database that contatins a row that needs some entries updated.
> 
> Can any one see a problem with the following code?
> 
> sub complete_final{
>   my $status = 'COMPLETE';
>   my $sth = $dbh ->prepare( qq{ INSERT INTO
>                                 vintek_support
>  
> (date_complete,time_complete,status,administrator,solution)
>                                 VALUES (?,?,?,?,?) WHERE unique_id =
> '$search_string1'
>                                } ) || die $dbh->errstr;
>   $sth->execute($date_added,$time_added,$status,$admin,$solution);
> }
> 
> Regards,
> 
> df
> 

Reply via email to