Make sure that
 1) Oracle is installed and working
 2) DBI installed ok
 3) DBD::Oracle installed ok

then, you'll need a proper connect statement - look at the
DBD::Oracle perldocs by doing

   perldoc DBD::Oracle

And then try the code below.

HTH.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

Kipp, James [[EMAIL PROTECTED]] wrote:
> you can just wrap the commands from the sql plus file into a prepare string.
> something like:
> 
> 
> my $sth = $dbh->prepare( "
>         SELECT *
>         FROM tbl_foo
>         WHERE description = $blah
>         # whatever statements you have in the sq file
>       " );
> $sth->execute();
> 
> perldoc dbi details
> 
> 
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, November 20, 2001 1:54 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: how to execute a sql command file within a perl script
> > 
> > 
> > Hi All,
> > Using a perl script (with the DBI module) I am trying to connect to a
> > oracle database using "sqlplus" (which is there in the oracle BIN
> > directory) and then executing a command file by using the 
> > command "start
> > commands.sql". Can somebody help me in implementing this ?? I 
> > am not very
> > sure about how to write the perl code for doing this. (Also 
> > please note
> > that the command file expects some input from the user. So 
> > please let me
> > know how to implement this code as well!!)
> > 
> > All help will be highly appreciated.
> > 
> > Thanks.
> > 
> > 

Reply via email to