SQLERROR()

From Recital Documentation Wiki
Revision as of 16:12, 4 July 2011 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Function to return the error message for the last remote data connection error


Syntax

SQLERROR(<nStatementHandle>)


See Also

CREATE CONNECTION, SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLDISCONNECT(), SQLEXEC(), SQLGETPROP(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLSTRINGCONNECT(), SQLTABLES()


Description

The SQLERROR() function is used to return the error message for the last remote data connection error.

The SQLERROR() function operates on the data source specified by <nStatementHandle>, which must be an active remote data connection handle.


Keywords Description
nStatementHandle The workarea in which the gateway data source is open.


Return values:

The SQLERROR() function returns a character string containing the descriptive message for the last error.


Example

nStatHand=SQLSTRINGCONNECT("rec@rec1:user1/pass1-/usr/recital/uas/data/southwind.tcpip",.T.)
if nStatHand < 1
    messagebox("Cannot make connection", 16, "SQL Connect Error")
else
    messagebox('Connection made', 48, 'SQL Connect Message')
    store "00010" to myVar
    SQLEXEC(nStatHand, "SELECT * FROM example WHERE account_no = ?myVar", "restab")
    if used("restab")
        browse
    else
        messagebox(SQLERROR(nStatHand),16,"SQL Error")
    endif
    SQLDISCONNECT(nStatHand)
endif

Products

Recital, Recital Server