Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Calling Oracle StoredProc using Win32:ODBC

by roboticus (Chancellor)
on Jan 12, 2013 at 03:56 UTC ( #1013005=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Calling Oracle StoredProc using Win32:ODBC
in thread Calling Oracle StoredProc using Win32:ODBC

ranijoseph:

As the Anonymous Monk states above, it's the namespace the package resides in. I'm using DBI with DBD::Oracle, so the code may not be exactly what Win32::ODBC would use.

The code would be something like:

... my $ST=$DB->prepare("call apps.package_name.sp_rank(?)"); my ($ST_result); ... $ST->bind_param_inout(1, \$ST_result, 0, { ora_type=>ORA_RSET } ); $ST->execute(); while (my $hr = $ST_result.fetchrow_hashref) { ... process data ... }

But in any case, to call the procedure, you just use a "call SPROC(args...)" statement as you would normally use "select * from table". The difficulty may be in returning a recordset. For DBD::Oracle we bind another variable ($ST_result above) to the output cursor, and then we can treat it as a statement handle and retrieve the results from it. You'll have to fiddle with that to make it work in Win32::ODBC.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re^3: Calling Oracle StoredProc using Win32:ODBC
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013005]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (13)
As of 2015-07-07 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls