Loo, Peter # PHX wrote:
> Hi,
> 
> I am trying to execute two SQL statements within one call to
> $dbh->do() and Perl DBI is not happy.
> 
> Here is a sample call:
> 
> $sql = qq{delete from some_table
>           where  condition_one
>           and    condition_two;
>           insert into some_table (col_1, col_2, col_3)
>           select col_1, col_2, col_3
>           from   another_table
>           where  condition_one
>           and    condition_two;};
> 
> Is this possible?
> 
> I have used multiple statements in the ODBC driver but have not done
> so in the Oracle driver.  Oracle driver is not working.


With Oracle, you can use an inline PL/SQL block:

$sql = qq{
    begin
       delete from ...;
       insert ...;
    end;
};

- Philip

Reply via email to