Hi,

> Is there anybody out there that can
> give an example of calling a stored
> proc from within perl and then fetch
> the result set returned by the proc?

Do you mean "result value" (scalar value in terms of perl)
or "result set" (more than one row)?
If you mean "result value" then you can use an in_out bind variable.

With Oracle you would write:
$cur->prepare ("begin :result := proc_Number_Rule_Validate(:param); end;");
$cur->bind_param_inout(":result",\$v1, 10);
$cur->bind_param (":param", $p );
$cur->execute;

(with ms sql you would propably use ? as placeholder and something different
than "begin ... end;")

If you mean "result set", then you have to cast the result returned by a
function to a sql type.

In Oracle it would be something like:
$cur->prepare ("select * from table ( cast ( proc_Number_Rule_Validate
(:1)))");
$cur->execute ($p);
while ($r = $cur->fetchrow_hashref)
{...}

AFAIK there is a similiar construct in ms sql.

Regards,
Martin


Reply via email to