Perl DBI - run SQL Script with multiple statements
- by guigui42
I have a sql file test.sql used to run some SQL (create object / update / delete / insert) that can look like this
CREATE TABLE test_dbi1 (
test_dbi_intr_no NUMBER(15)
, test_dbi_name VARCHAR2(100);
UPDATE mytable
SET col1=1;
CREATE TABLE test_dbi2 (
test_dbi_intr_no NUMBER(15)
, test_dbi_name VARCHAR2(100);
Usually, i would just use SQLPLUS (from within Perl) to execute this test.sql using this command :
@test.sql
Is there a way to do the same thing, using DBI in Perl ?
So far, i found DBI can only execute one statement at a time, and without the ";" at the end.