(*****************************************************************************)
(* MODULE: SQLERRS^                                                          *)
(* AUTHOR: Peter Blair                                                       *)
(* RIGHTS: Reggatta Systems, Inc. - COPYRIGHT 1995 - 2000                    *)
(*****************************************************************************)
Unit SqlErrs;
{$I BAPI.INC}
Interface
Uses
  Windows,
  BDE,

  BseErrs,
  BseTypes,

  BtrErrs;

Type
  EScalableSQLEngineError = Class( EBtrieveEngineError );

Procedure ThrowScalableSQLException( Error : SmallInt );
Procedure ThrowScalableSQLExceptionMsg( Error : SmallInt; Const ErrorMsg : ShortString );
Function  TestScalableSQLResult( Status : SmallInt ) : SmallInt;

Implementation
Uses
  SysUtils,

  BseUtils,
  BseConst,

  BtrConst;

{$I BTRIEVE.INC}

Function TestScalableSQLResult( Status : SmallInt ) : SmallInt;
begin
  Result := Status;
  Case Status of
    ISAM_SUCCESS:
       ;
    ISAM_EOF:
      ThrowEOFException;
  else
    if ( Status > 0 ) then
      ThrowScalableSQLException( Status );
  end;
end;


Procedure ThrowScalableSQLException( Error : SmallInt );
begin
  Raise EScalableSQLEngineError.Create( Error )
end;


Procedure ThrowScalableSQLExceptionMsg( Error : SmallInt; Const ErrorMsg : ShortString );
begin
  Raise EScalableSQLEngineError.CreateMsg( Error, ErrorMsg );
end;


end.
