Title: RE: Perl DBI/SQL question - For those who use it...

I think I just answered my own question after reading through Charlie's example code...

The errors that would be spit to the screen would be returned in $DBI::errstr. 

Lisa

-----Original Message-----
From: Koivu, Lisa
Sent: Friday, January 03, 2003 1:09 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: Perl DBI/SQL question - For those who use it...


Jared, thanks for your reply.

One last question:  Is SPOOL one of the commands that DBI does not understand?  I would need to capture any errors spit out by sql*plus (like my famous ora-1410 error).  I have a feeling the answer is yes.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 12:30 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Perl DBI/SQL question - For those who use it...


Lisa,

No, you can't call a sql script from Perl/DBI, sorry.

The SQL scripts you refer to are for SQL*Plus, and contain
a number of commands that DBI doesn't know what to do with.

Your SQL can be stored in a different file to avoid script modification
for different SQL, but that requires a little work on your part.

Ask privately if you need examples.

Then there's SQLMinus by Tom Lowery, a sqlplus emulator
that is a work in progress.  I don't know if it will yet read a sqlplus
formatted sql script.  Check search.cpan.org.

I'm also working on a Perl module to allow sqlplus like breaks,
computes and subtotals, but that too is a WIP.

If fact, it's not even to alpha stage yet.

Jared





"Koivu, Lisa" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
 01/03/2003 09:09 AM
 Please respond to ORACLE-L

 
        To:     Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc:
        Subject:        Perl DBI/SQL question - For those who use it...


Hi everyone,
This may be a stupid question.  If so please humor me with a stupid
answer. However:
I FINALLY have the fun fun fun chance to change one of my data loads to
use the DBI instead of the procedures I hacked together.  In true ksh
style I had written my loads to fire a sql script (calling a stored proc)
that was stored separately.  It seems to me the DBI wants the text of the
sql script embedded piece by piece in the code.  I have looked around for
examples because even though the DBI seems straightforward, it doesn't
take much to confuse me.  I don't see examples of firing a sql script from
the DBI (like this sqlplus /@dbname < @script.sql > logfile.log ... Gosh
do I miss unix, everything was SO EASY)
So my questions to you, my learned friends, are:
1. is it not perl-style to store the sql in a separate file?  I understand
I may be missing the opportunity for more specific error handling here but
honestly at this point it does not matter.  The thing fails, I restart the
whole script.
2. Does anyone have an example of firing the DBI and calling a sql script
like I could so easily do in ksh?
Any and all comments are welcome.  Thank you
I wish everyone a rested and relaxing weekend.
Lisa Koivu
Oracle Database Monkey
Fairfield Resorts, Inc.
5259 Coconut Creek Parkway
Ft. Lauderdale, FL, USA  33063

Reply via email to