John wrote: >> Can anyone see the error in the following code. It has to do with the
>> placeholder in the select statement. Substitution fails to occur at >> the "$sth1->execute..." statement script dies at "while (my >> $rowref...". If I replace the placeholder with a literal it works as >> expected. >> >> [code] snipped I'm not sure if this is relevant because of differences in the database type, but here goes... We had a similar problem with an Oracle database, and from an item on this list I found the following which fixed our issue. "CHAR column values are padded with spaces to the length of the column. When compared with a literal, the SQL engine automatically adds the padding to the literal. When compared with a placeholder, the blank padded semantics are not available unless the placeholder type is CHAR." Evidently this is not unique to the Perl DBI, it was documented in the Oracle OCI manual. Is it possible that SQLite is similar? If so you may need something similar to this: use DBD::Oracle qw(:ora_types); ... # after connect but before prepare $dbh->{ora_ph_type} = ORA_CHAR; FWIW, Hope it helps. Paula