UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

Return Values The following table describes the return values of the SQLDisconnect function. 1-806 UniBasic Commands Reference Return Value Description 0 SQL.SUCCESS 1 SQL.SUCCESS.WITH.INFO −1 SQL.ERROR −2 SQL.INVALID.HANDLE SQLDisconnect Return Values

SQLError Syntax status = SQLError (bci.env, connect.env, statement.env, sqlstate, dbms.code, error) Note: This function is case-sensitive. If you want it to be case-insensitive, you must compile your programs using the BASIC command with the -i option. Description SQLError returns error status information about one of the three environments you use. Use SQLError when a function returns a status value other than SQL.SUCCESS or SQL.INVALID.HANDLE. SQLError returns a value in sqlstate when UniData BCI detects an error condition. The dbms.code field contains information from the data source that identifies the error. Each environment type maintains its own error status. SQLError returns errors for the rightmost nonnull environment. For example, to get errors associated with a connection environment, specify input variables and constants in the following order: bci.env, connect.env, SQL.NULL.HSTMT To get errors associated with a particular SQL statement environment, specify the following: bci.env, connect.env, statement.env If all arguments are null, SQLError returns a status of SQL.NO.DATA.FOUND and sets SQLSTATE to 00000. Since multiple errors can be returned for a variable, you should call SQLError until it returns a status of SQL.NO.DATA.FOUND. This ensures that all errors are reported. SQLError 1-807

SQLError<br />

Syntax<br />

status = SQLError (bci.env, connect.env, statement.env, sqlstate, dbms.code, error)<br />

Note: This function is case-sensitive. If you want it to be case-insensitive, you<br />

must compile your programs using the BASIC command with the -i option.<br />

Description<br />

SQLError returns error status information about one of the three environments you<br />

use.<br />

Use SQLError when a function returns a status value other than SQL.SUCCESS or<br />

SQL.INVALID.HANDLE. SQLError returns a value in sqlstate when UniData BCI<br />

detects an error condition. The dbms.code field contains information from the data<br />

source that identifies the error.<br />

Each environment type maintains its own error status. SQLError returns errors for<br />

the rightmost nonnull environment. For example, to get errors associated with a<br />

connection environment, specify input variables and constants in the following order:<br />

bci.env, connect.env, SQL.NULL.HSTMT<br />

To get errors associated with a particular SQL statement environment, specify the<br />

following:<br />

bci.env, connect.env, statement.env<br />

If all arguments are null, SQLError returns a status of SQL.NO.DATA.FOUND and<br />

sets SQLSTATE to 00000.<br />

Since multiple errors can be returned for a variable, you should call SQLError until<br />

it returns a status of SQL.NO.DATA.FOUND. This ensures that all errors are<br />

reported.<br />

SQLError 1-807

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!