Yes you can.  Here is an example.

$sth_tbs_mode = $dbh->prepare("BEGIN SYS.BACKUP.BEGIN_BK(?); END;");
$sth_tbs_mode->execute($tablespace_name);

Or  you can use do if you are not passing any parameters.

$dbh->do("BEGIN SYS.BACKUP.BEGIN_BK('USERS'); END;");  
$dbh->do ("ALTER SYSTEM .......");

I don't use do too much so I am not sure about the quotes around USERS.
Read the Docs there are a few examples in the docs.  Or another good
resource is Programming the Perl DBI.

You can read the docs from the command line by typing:
Perldoc DBI

I hope that helps.  If you have any other questions let me know.

Thanks,
Sam Gold

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 18, 2004 7:47 AM
To: [EMAIL PROTECTED]
Subject: can I execute DBMS packages with DBI?


Hi all

I was wondering whether or not I can run commands other than the typical
SELECT, INSERT, UPDATE & DELETE. For instance, I am working with Oracle and
would like to launch with Perl scripts that would use the DBMS_STATS
package. And I would also like to launch commands such as: alter
database..., alter system..., alter table..., alter index..., create
tablespace..., alter tablespace..., drop tablespace..., alter datafile...,
etc, etc, etc.

Has anybody done that before? Can I just use the "do->" command to do those
tasks mentioned above?

Thanks in advance for your wise advise. :-)

Marc Torres Alvarez



Reply via email to