Hi,
You may want to read the DBI documentation about prepared statements. A prepared statement is one where instead of actually putting values in the sql, placeholders (?) are used instead. Then the statement can be resused a bunch of times with different data sets. Prepared statements have a number of advantages with regards to security, performance, and reusability all of which are dicussed in the DBI documentation.
Here is an example:
$sql = "select colnm from tblnm where colmn in (?,?,?); $st = $dbh->prepare($sql); # Select where colmn in (1, 2, 3) $st->execute(1, 2, 3); .... # Select where colmn in (4, 5, 6) $st->execute(4, 5, 6);
And so on. In general, the SQL will not contain the values. The values (@array) are passed in during each execution.
Hope this helps.
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)In reply to Re: Explanation of Code Problem
by TedYoung
in thread Explanation of Code Problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |