John Delacour wrote: > At 11:08 -0600 28/01/2011, Puneet Kishor wrote: > >> Can't really say what you are doing wrong, but you code is needlessly >> complicated; all those tildes are making my eyes swim. > > I also have difficulty interpreting escaped toothpicks, and I didn't > joint the sqlite list to have my Perl style polished. Besides, there > is absolutely no way the Perl could be made less complicated. >
hmmm... must say that was taken differently than it was intended, so I will leave it at that. >> I would do the >> following >> >> my $q = "Delete c10"; >> $q =~ s/(\d+)//; >> my $sth = $dbh->prepare('DELETE FROM contacts WHERE rowid = ?'); >> my $rows_affected = $sth->execute($q); > > > Why would you do this rather than use $dbh->do ? It seems to add a > line of code to no purpose. Because I find using bind values easier, clearer, and safer, even for one-off execute statements. > And besides, whereas the 'do' routine > works fine in the standalone script, yours works in neither. > I didn't try my code, but I am curious -- what do you mean by "works in neither"? do you get any error? or, is the row not deleted at all? or both? -- Puneet Kishor _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users