Connecting Tech Pros Worldwide Forums | Help | Site Map

Perl calling a Oracle PL/SQL script

Newbie
 
Join Date: Apr 2007
Posts: 2
#1: Apr 2 '07
I am new to perl and need help with the following. In perl we are calling sqlplus with a PLSQL Script. In order to do this in PERL we had to do a system call. How do we return a error code from the PLSQL script back to the perl script?

KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#2: Apr 2 '07

re: Perl calling a Oracle PL/SQL script


You should be using the DBI module to interface with your database.

If you literally mean you are using:

system()

to access the database, there is no way to get back error messages from the database that I know of.
Newbie
 
Join Date: Apr 2007
Posts: 2
#3: Apr 2 '07

re: Perl calling a Oracle PL/SQL script


Kevin

If we have a PLSQL script how would we rub this script using the DBI module?
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#4: Apr 2 '07

re: Perl calling a Oracle PL/SQL script


Quote:

Originally Posted by davidr262

Kevin

If we have a PLSQL script how would we rub this script using the DBI module?


Read the DBI documentation:

http://search.cpan.org/~timb/DBI-1.54/DBI.pm

and you will need the particular driver for PLSQL, you can search for that on CPAN too.

I can't help you with code examples because my experience and knowledge is quite limited in regards to database applications and the DBI module in general.
Member
 
Join Date: Nov 2006
Location: USA
Posts: 126
#5: Apr 3 '07

re: Perl calling a Oracle PL/SQL script


Well you could use the system call because from what you are saying you are running the sqlplus commands, in the plsql code. define the dbms_output error line as a perl variable and run a perl print statement or print to a log or whatever.
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#6: Apr 3 '07

re: Perl calling a Oracle PL/SQL script


Quote:

Originally Posted by jonathan184

Well you could use the system call because from what you are saying you are running the sqlplus commands, in the plsql code. define the dbms_output error line as a perl variable and run a perl print statement or print to a log or whatever.

Sounds like a very plausible suggestion.
Reply