Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call stored procedure from Perl

Status
Not open for further replies.

perln00b

Programmer
Oct 4, 2005
21
US
I created a stored procedure from Oracle9i to deal with some data transactions from DB to DB. I am going to use Perl
to handle the following actions:
1) connect to the database
2) call stored procedure
3) catch any messages from DBMS_OUTPUT.print_line() inside
my stored procedure.

Does anyone have any clues/hints/suggestions to handle
those?

Thanks,
Lucas
 
Lucas,

Is this an assignment or homework?

Mike

I am not inscrutable. [orientalbow]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Code:
Is this an assignment or homework?

This is neither an assignment nor homework. I know how to
use Java to handle this. Unfortunately, my environment does
not allow me to use Java. I can either use Perl or batch
files, but I don't what is the best way to handle this. And
I am not familiar using perl just like my screen name i am
a noob in Perl. I did search in google, but I did't get
any good result. Hopefully, I can get a good suggestion
from some experts from this forum. But thank you for
your answer.

Lucas
 
For PostgreSQL I would just pass the same command I would enter from the psql shell, execpt I would pass it to the database server using perl. I would assume you would do the same for oracle.


Regards,

LelandJ

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Below is a link to [Programming the Perl DBI]. If you click on [Appendix B: Driver and Database Characteristics] and the go down to [DBD::Oracle], you will find some, hopefully helpful, examples of calling a stored procedure in Oracle.


Regards,

LelandJ

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Code:
dbms_output_enable

$dbh->func('dbms_output_enable');

Enables the DBMS_OUTPUT package. The DBMS_OUTPUT package is typically used to receive trace and informational messages from stored procedures.
Thank you very much, LelandJ!! Great appreciated.
Since my stored procedure handles all the business logics,
I just need to catch all thoes messages. That's a great
information that i need it. And also I found other useful
information.

Regards,
Lucas
 
Fair enough Lucas, I hope that Leland's post answered your query.

Mike

I am not inscrutable. [orientalbow]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top