class SQLAnywhereException extends AbstractDriverException (View source)

SAP Sybase SQL Anywhere driver exception.

Methods

__construct(string $message, string|null $sqlState = null, integer|string|null $errorCode = null)

Constructor.

integer|string|null
getErrorCode()

Returns the driver specific error code if available.

string|null
getSQLState()

Returns the SQLSTATE the driver was in at the time the error occurred.

fromSQLAnywhereError(resource|null $conn = null, resource|null $stmt = null)

Helper method to turn SQL Anywhere error into exception.

Details

__construct(string $message, string|null $sqlState = null, integer|string|null $errorCode = null)

Constructor.

Parameters

string $message The driver error message.
string|null $sqlState The SQLSTATE the driver is in at the time the error occured, if any.
integer|string|null $errorCode The driver specific error code if any.

integer|string|null getErrorCode()

Returns the driver specific error code if available.

Returns null if no driver specific error code is available for the error raised by the driver.

Return Value

integer|string|null

string|null getSQLState()

Returns the SQLSTATE the driver was in at the time the error occurred.

Returns null if the driver does not provide a SQLSTATE for the error occurred.

Return Value

string|null

static SQLAnywhereException fromSQLAnywhereError(resource|null $conn = null, resource|null $stmt = null)

Helper method to turn SQL Anywhere error into exception.

Parameters

resource|null $conn The SQL Anywhere connection resource to retrieve the last error from.
resource|null $stmt The SQL Anywhere statement resource to retrieve the last error from.

Return Value

SQLAnywhereException

Exceptions

InvalidArgumentException