Error conditions that arise during processing of a SQL request made in ANSI mode are returned to the application through SQLCODE or SQLSTATE, which are documented in “Result Code Variables” in Teradata Vantage™ - SQL Stored Procedures and Embedded SQL, B035-1148.