in reply to Calling Oracle StoredProc using Win32:ODBC
For calling Oracle stored procs (which I do *all the time*), I do it like this:
... my $ST=$DB->prepare("call apps.package_name.proc(?, ?, ?)"); my ($ST_result, $arg1, $arg2); ... $ST->bind_param(1, $arg1); $ST->bind_param(2, $arg2); $ST->bind_param_inout(3, \$ST_result, 0, { ora_type=>ORA_RSET } ); $ST->execute(); while (my $hr = $ST_result.fetchrow_hashref) { ... process data ... }
This is for a stored procedure that looks something like:
procedure proc( arg1 in varchar(32), arg2 in number, result out sys_cursor ) as begin open result for select col1, col2, 'FOO' col3 from tableFoo where col7=arg1 or col8=arg2 ; end;
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Calling Oracle StoredProc using Win32:ODBC
by mje (Curate) on Jan 14, 2013 at 13:21 UTC | |
Re^2: Calling Oracle StoredProc using Win32:ODBC
by ranijoseph (Initiate) on Jan 11, 2013 at 20:30 UTC | |
by roboticus (Chancellor) on Jan 12, 2013 at 03:56 UTC | |
by Anonymous Monk on Jan 11, 2013 at 21:28 UTC |
In Section
Seekers of Perl Wisdom