Pascal Data Objects

function IPDOStatement.errorCode: AnsiString;

This function fetches the SQLSTATE associated with the last operation on the statement handle. It is Identical to TPDO.errorCode function, except that IPDOStatement.errorCode only retrieves error codes for operations performed with IPDOStatement objects.

Example

  db.prepare_as_is ('SELECT skull FROM bones');
  stmt := db.execute;
  writeln ('IPDOStatement.errorCode(): ' + stmt.errorCode);

The above example will output:

IPDOStatement.errorCode(): 42S02