|
Hi Lisa,
It's been awhile since I've used Perl DBI, but from
what you said, I think you're mixing up two different ideas. Ksh doesn't know
how to talk to a database, so you just use it to invoke sqlplus, which handles
the database communication and runs the script. Perl is also capable of doing
the _exact_ same thing, but you would not be using the DBI, you would just be
using Perl to invoke sqlplus. Here's a one-liner example:
cat > test.sql
select sysdate from
dual;
quit
<Ctrl-d>
perl -e 'system("sqlplus", "-s",
"scott/tiger", "\@test")'
This is completely different from using the DBI.
You use the DBI when you want more flow control and error handling, etc... You
can still keep your scripts in a separate file if you really want to, just read
them into a variable and prepare() and execute() it. Personally, I would define
my DBI SQL in the perl file -- easier to keep track of it
there.
If you like, you can contact me off-list and I can
show you some things I've written. In fact, you're right down the road from me
--- Do you go to the SF Oracle User Group meetings?
--
Philip Douglass Internet Networking Group Database Administrator SIRS Publishing, Inc. 1100 Holland Dr.
Boca Raton, FL 33487
|
Title: Perl DBI/SQL question - For those who use it...
- Perl DBI/SQL question - For those who use it... Koivu, Lisa
- Re: Perl DBI/SQL question - For those who use it... Jared . Still
- Re: Perl DBI/SQL question - For those who use it... Tim Bunce
- RE: Perl DBI/SQL question - For those who use it... Koivu, Lisa
- RE: Perl DBI/SQL question - For those who use it... Koivu, Lisa
- Re: Perl DBI/SQL question - For those who use it... Alex
- RE: Perl DBI/SQL question - For those who use it... Philip Douglass
- RE: Perl DBI/SQL question - For those who use it... Koivu, Lisa
- Re: Perl DBI/SQL question - For those who use it... Markus Reger
