Re: Oracle Function Calls
| From: | Joe Brown | Date: | Thu, 08 Mar 2001 03:25:03 +0000 |
| Subject: | Re: Oracle Function Calls | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7179@lists.php.net to get a copy of this message | ||
this chunk of code comes out of
http://www.php.net/manual/en/function.ocinewcursor.php
<?php
// suppose your stored procedure info.output returns a ref cursor in :data
$conn = OCILogon("scott","tiger");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"begin info.output(:data); end;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);
while (OCIFetchInto($curs,&$data)) {
var_dump($data);
}
OCIFreeCursor($stmt);
OCIFreeStatement($curs);
OCILogoff($conn);
?>
Hope that helps, I havn't gone there (yet).
""Richard S. Crawford"" <rscrawford@mossroot.com> wrote in message
news:5.0.2.1.0.20010307131015.0200ca20@mail.mossroot.com...
> Ah! My bad! I sent this question out with the wrong subject line. My
> apologies to everyone that I confused.
>
>
> At 01:07 PM 3/7/01 -0800, Richard S. Crawford wrote:
>
>
> >I desperately need to know whether it is possible to call an Oracle
> >function in PHP. For example...
> >
> >$functionResult=hubins($name,$commit_yn)
> >
> >where hubins is a stored procedure in our Oracle database.
> >
> >Can this be done? My first thought was to do something like this:
> >
> >$functionCall="hubins($name,$commit_yen)";
> >
> >then then do
> >
> >ociexecute($functionCall);
> >
> >...but that, of course didn't work.
> >
> >Any thoughts?
> >
> >
> >--
> >PHP Database Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> >For additional commands, e-mail: php-db-help@lists.php.net
> >To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
> --
> http://www.mossroot.com/index.php
> AIM Handle: Buffalo2K
> e-mail: rscrawford@mossroot.com
> "When you lose the power to laugh at yourself, you lose the power to think
> straight." --Clarence Darrow
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>