The alMIGHTY N wrote:
> wrote:
>> That said, you could run sqlplus in backticks and parse the returned
>> value.
> Hi, thanks for the reply! After all the searching I've done these past
> couple of days, I came to the same conclusion. I'm putting together a
> quick script that uses DBI to do everything, but I'm still holding out
> hope that there's some solution to this (the senior developers are not
> keen on adding a new module to the system especially since this is such
> a small part of the applicatiion).
If they are "Senior Developers" and they use perl to access
the database, then DBI would already be installed. Also, why
not go to them for help? It's likely you'd already have finished
this project and done it in a way that's supported at your
company.
> How would one go about running sqlplus "in backticks"?
One would first look through the documentation for 'backticks' so
one would learn what it means and one would probably find the
answer on one's own.
The answer would be, "The same as you would run any other command 'in
backticks'."
Look for "qx" in perldoc perlop.
and
perldoc -q "Why can't I get the output of a command with system()"
and
perldoc -q "How can I capture STDERR from an external command"
If you have shell scripts already set-up and, for some reason, you
want to execute those scripts and get the output into a variable in a
perl script, then you could call the shell script, in backticks.
my $script_output = `/some/path/to/script`;
SQLPlus can offer some nice formatting options so depending on your need
using DBI or calling a shell script would be possible solutions.