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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing stored procedures from Perl via ODBC

Status
Not open for further replies.

BMO

Programmer
Aug 20, 2001
7
0
0
GB
Can anyone help me with the Perl syntax for executing stored procedures on an ORACLE database? The procedure is in a database package and needs to be passed a in parameter and also an out parameter. I've looked at some sites on the web but am confused! I can connect to the database via ODBC execute SQL statements but I do not know how to execute procedures.

Thanks
 
Hi

I don't know about Oracle but with MSsql you can run a stored proc from the command line using osql and the relevant parameters. You can call this from perl using the backticks or exec or even system functions. This enables you to put parameters where you need them.. If the command line query is returning a value you can do the following

Code:
$val = `osql rest of osql statement here`;

this will parse the return value into the $val variable.

I think with Oracle you can do a similar thing using sqlplus.

Hope I'm not too far off the mark and that this helps

Cheers
AcidHawk ----
Of All the things I've lost in my life it's my mind I miss the most.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top