Difference between revisions of "SQLERROR()"

From Lianjapedia
Jump to: navigation, search
m (Text replace - "Recital" to "Lianja")
Line 48: Line 48:
  
 
==Products==
 
==Products==
Recital, Recital Server
+
Lianja, Lianja Server
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Revision as of 01:23, 9 December 2012

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

Lianja, Lianja Server