SqlGetError(sqlquery)

From NWN Lexicon
Jump to: navigation, search
Nwnee logo.jpg Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Returns "" if the last SQL command succeeded; or a human-readable error otherwise.

void SqlGetError(
    sqlquery sqlQuery
);

Parameters

sqlQuery
SQL query to check

Description

Returns "" if the last SQL command succeeded; or a human-readable error otherwise.

Additionally, all SQL errors are logged to the server log.

Remarks

This is useful to check if there is a problem with the last SQL command issued if it is a potentially problematic one. If blank it is fine, if not then the error can be printed somewhere and error handling can take place.

Version

This function was added in 1.80.8193.14 of NWN:EE.

Example

See Also

functions:

SqlPrepareQueryCampaign SqlPrepareQueryObject