I would like to know if it is possible to execute more than one SQL statement within one execute()or do()using DBD::OraclePerl DBI. Example:
$sql = 'UPDATE foo SET bar = 123; DELETE FROM foo WHERE baz = 456';
$sth = $dbh->prepare($sql);
$sth->execute;
$dbh->do($sql);
I ask this not because I really want to do this, but because I want to assess the potential damage due to a successful SQL injection attack. And yes, I know that, regardless of the answer to this question, the possibility of SQL injection should still be eliminated in the root, using binding values and only trusted input, etc. But the question still remains: is it possible to DBD::Oracledo multiple statements?
As a related example, it DBD::mysqlhas mysql_multi_statements, which explicitly includes this function. I cannot shake the feeling that there is some kind of similar, possibly undocumented and incomprehensible Oracle OCI option, available in some way through DBD::Oracle, which will include the same thing.
In case it matters, it is:
perl 5.8.8DBD::Oracle 1.22- Oracle 11g (01/11/0700)
source
share