Ora8IgnoreError Function

Action

Specifies that a specific Oracle 8 OCI error is to be ignored if it occurs during the next Silk Performer Oracle 8 API function call. Since the error is then treated in the same way as a warning, the simulation will not be aborted.

Include file

Ora8.bdh

Syntax

Ora8IgnoreError( in hHandle    : number,
                 in nErrorCode : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hHandle Handle.
nErrorCode Oracle 8 OCI error code. This error will be treated as a class 0 error (warning) for the next Silk Performer Oracle 8 API call.

Example

var
  ghEnv0        : number;
  ghError0      : number;
  ghStmt0       : number;
  ghSvcCtx0     : number;

dcltrans
  transaction TMain
  begin
    Ora8Init(ghEnv0, OCI_DEFAULT);
    Ora8HandleAlloc(ghEnv0, ghError0, OCI_HTYPE_ERROR);
    Ora8Logon(ghEnv0, ghSvcCtx0, "user", "password", "orclnet2");
    Ora8HandleAlloc(ghEnv0, ghStmt0, OCI_HTYPE_STMT);
    Ora8StmtPrepare(ghStmt0, sqlDelete, OCI_NTV_SYNTAX);

    // ignore Oracle error 900: invalid SQL statement
    Ora8IgnoreError(ghStmt0, 942);

    // execute invalid SQL statement
    Ora8StmtExecute(ghSvcCtx0, ghStmt0);

    Ora8HandleFree(ghStmt0, OCI_HTYPE_STMT);
    Ora8Logoff(ghSvcCtx0);
    Ora8HandleFree(ghError0, OCI_HTYPE_ERROR);
    Ora8HandleFree(ghEnv0, OCI_HTYPE_ENV);
  end TMain;

dclsql
  sqlDelete:
    REMOVE FROM my_table;   // invalid SQL statement