Release 10.1A: OpenEdge Data Management:
SQL Reference

> ## DhSQLException.getDiagnostics

> Returns the requested detail about an exception.

> ##### Format

> `public String getDiagnostics(int` `diagType``)`

> ##### Returns

> A string containing the information specified by the `diagType` parameter, as shown in Table 54.

> ##### Parameters

> `diagType`

> One of the argument values listed in Table 54.

> Table 54: Argument values for DhSQLException.getDiagnostics
> Argument value | Returns
> --- | ---
> `RETURNED_SQLSTATE` | The `SQLSTATE` returned by execution of the previous SQL statement.
> `MESSAGE_TEXT` | The condition indicated by `RETURNED_SQLSTATE.`
> `CLASS_ORIGIN` | Not currently used. Always returns `NULL.`
> `SUBCLASS_ORIGIN` | Not currently used. Always returns `NULL.`

> ##### Throws

> `DhSQLException`

> Example

> This code fragment illustrates `DhSQLException.getDiagnostics`:

>     try
>     {
>          SQLIStatement insert_cust = new SQLIStatement (
>          "INSERT INTO customer VALUES (1,2) ");
>     }
>     catch (DhSQLException e)
>     {
>          errstate = e.getDiagnostics (RETURNED_SQLSTATE) ;
>          errmesg  = e.getDiagnostics (MESSAGE_TEXT) ;
>              .
>              .
>              .
>     }

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095