my $sth = $dbh->prepare("Insert into customers (Names) select ? from dual where not exists (select Names from Customers where Names = ?") $sth->execute($name,$name);