SQLNativeSql returns the SQL string that the driver translates.
The following table describes the SQLSTATE and error values for SQLNativeSql.
| SQLSTATE | Error Value | Error Message |
|---|---|---|
| 01000 | -11001 | General warning |
| 01004 | -11003 | Data truncated |
| 08003 | -11017 | Connection not open |
| 37000 | -11035 | Syntax error or access violation |
| S1000 | -11060 | General error |
| S1001 | -11061 | Memory-allocation failure |
| S1009 | -11066 | Invalid argument value |
| S1090 | -11071 | Invalid string or buffer length |
| S1000 | -11320 | Syntax error |
| S1000 | -11323 | The statement contains an escape clause not supported by this database driver |
The following example shows what SQLNativeSql might return for an input SQL string that contains the scalar function LENGTH:
SELECT {fn LENGTH(NAME)} FROM EMPLOYEE
Dynamic Server might return the following translated SQL string:
SELECT length(NAME) FROM EMPLOYEE