On Tue, May 08, 2001 at 03:01:58PM -0700, Robert Mena wrote:
> Hi, I am accessing an oracle database from PHP using
> stored procedures available.
> 
> I'd like to detect when a problem occurs in order to
> stop trying to fetch results.  In mysql I check for
> rc=0 as an error.  The php doc does not tell if this
> applies to oracle as well.
> 
> The code is something like this 
> $res = OCINewCursor($oraCon); 
> $stm = OCIParse ( $oraCon, " 
> BEGIN 
>   MY_PROCEDURE(:LOGIN, :PASS, :KEY, :INITIAL, :FINAL,
> :RES); 
> END; 
> "); 
> 
> OCIBindByName ( $stm, ":LOGIN", &$login, -1); 
> OCIBindByName ( $stm, ":PASS", &$pass, -1); 
> OCIBindByName ( $stm, ":KEY", &$key, -1); 
> OCIBindByName ( $stm, ":INITIAL", &$initial, -1); 
> OCIBindByName ( $stm, ":FINAL", &$final, -1); 
> OCIBindByName ( $stm, ":RES", &$res, -1, OCI_B_CURSOR
> ); 
> 
> $rc = @OCIExecute ( $stm ); 
> if($rc)
> {
>       OCIExecute ($res); 
> ...
> }
> else
> {
>         // Error do something!
    $err = OCIError($stm);
    var_dump($err);

> }
> 
> Thanks.

    re,
    tc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to