Guest_imported
New member
- Jan 1, 1970
- 0
Hi
I am able to connect to oracle database and insert records by calling a SP.(Stored procedure). This is the program for that which is working fne.
if (open (infl,"$indir/$filenm"
{
$dbh=DBI->connect("DBI:Oracle:BSCSDEV",mnp,mnp789) or "$!\n";
while ($record=<infl>)
{
chomp ($record);
$rec++;
#print "$record \n";
@param = split('\|',$record);
$r=""; # Return value of SP
$inp1 = $param[0]; #in param for SP
$inp2 = $param[1];
$inp3 = $param[2];
$inp4 = $param[3];
$inp5 = $param[4];
$inp6 = $param[5];
$inp7 = $param[6];
$inp8 = $param[7];
#print "$inp1 $inp2 $inp3 $inp4 $inp5 $inp6 $inp7 $inp8
\n";
$sqlqry=$dbh->prepare (q{
BEGIN
mvno_create_npr( :inp1, :inp2, :inp3, :inp4, :inp5, :inp
6, :inp7, :inp8, :r);
END;});
$r = 0;
$sqlqry->bind_param(":inp1",$inp1);
$sqlqry->bind_param(":inp2",$inp2);
$sqlqry->bind_param(":inp3",$inp3);
$sqlqry->bind_param(":inp4",$inp4);
$sqlqry->bind_param(":inp5",$inp5);
$sqlqry->bind_param(":inp6",$inp6);
$sqlqry->bind_param(":inp7",$inp7);
$sqlqry->bind_param(":inp8",$inp8);
$sqlqry->bind_param_inout(":r",\$r,1);
$sqlqry->execute;
Same way I want to call a function which returns a ref cursor. How to call this function. The following are the parameters for the function. Also the output of the cursor i want to store in a file.
Please help on this at the earliest
variable CUR refcursor
execute :CUR := select_mvno_npr_port_in('SHELL', '20011031', '01:00')
print CUR