OraOciError Function

Action

Retrieves the Oracle OCI error code if an OCI error occurred during the last Silk Performer Oracle API function call.

Include file

Ora.bdh

Syntax

OraOciError(): number;

Return value

Oracle OCI error code.

A Silk Performer Oracle API error has occurred if a Silk Performer Oracle API function fails and the OraOciError returns 0. In this case, the OraApiError function can be used to retrieve the Silk Performer Oracle API error code

Example

var
  hConnection : number;
  cCursor : cursor;

dcltrans
  transaction TMain
  begin
    OraLogon(hConnection, "user", "password", "orclnet2");
    OraOpen(cCursor, hConnection);
    OraParse(cCursor, sqlSelect);

    // select row from non existing table
    OraIgnoreError(cCursor, 942);
    OraExec(cCursor);
    write("Oracle OCI error: "); write(OraOciError()); writeln;
    write(OraLastErrorText()); writeln;
        
    OraClose(cCursor);
    OraLogoff(hConnection);
  end TMain;

dclsql
  sqlSelect:
    SELECT * FROM non_existing_table;

Output

Oracle OCI error: 942
OCI-API Class 0 Error (Warning) 942 in OraExec(OEXEC, OEXN):
ORA-00942: table or view does not exist