Difference between revisions of "SQLERROR()"

From Lianjapedia
Jump to: navigation, search
m (Text replace - "Recital" to "Lianja")
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to return the error message for the last remote data connection error
 
Function to return the error message for the last remote data connection error
 
  
 
==Syntax==
 
==Syntax==
 
SQLERROR(<nStatementHandle>)
 
SQLERROR(<nStatementHandle>)
 
  
 
==See Also==
 
==See Also==
 
[[CREATE CONNECTION]], [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]]
 
[[CREATE CONNECTION]], [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]]
 
  
 
==Description==
 
==Description==
Line 15: Line 12:
  
 
The SQLERROR() function operates on the data source specified by <nStatementHandle>, which must be an active remote data connection handle.
 
The SQLERROR() function operates on the data source specified by <nStatementHandle>, which must be an active remote data connection handle.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 23: Line 19:
 
|-
 
|-
 
|}
 
|}
 
  
 
====Return values:====
 
====Return values:====
 
The SQLERROR() function returns a character string containing the descriptive message for the last error.
 
The SQLERROR() function returns a character string containing the descriptive message for the last error.
 
  
 
==Example==
 
==Example==

Revision as of 11:14, 11 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