PowerBuilder · Database exception

DBError Event Code -4 (Uncategorized Database Error)

What does DBError Event Code -4 (Uncategorized Database Error) mean in PowerBuilder?

PowerBuilder passes -4 as the code argument of the DBError event as the catch-all fallback for any database error that isn't a connection failure, a blob write failure, or a case where the driver supplied its own native DBMS error code. It is the value developers see most often for miscellaneous execution errors on drivers that don't populate SQLDBCode.

DBError Event Code -4 (Uncategorized Database Error)PowerBuilder Classic · Appeon PowerBuilder

Condition

PowerBuilder passes -4 as the code argument of the DBError event as the catch-all fallback for any database error that isn't a connection failure, a blob write failure, or a case where the driver supplied its own native DBMS error code. It is the value developers see most often for miscellaneous execution errors on drivers that don't populate SQLDBCode.

Fix

Treat -4 as a generic signal to fall back on sqlerrortext and sqlsyntax (the SQL statement text passed to the event) for diagnosis, since no numeric DBMS code accompanies it. Log the full sqlsyntax argument so the exact failing statement can be reproduced outside PowerBuilder.

Related database exception