Difference between revisions of "SQLGETPROP()"

From Lianjapedia
Jump to: navigation, search
 
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Query property settings for a connection or the environment
 
Query property settings for a connection or the environment
 
  
 
==Syntax==
 
==Syntax==
 
SQLGETPROP(<nStatementHandle>, <cSetting>)
 
SQLGETPROP(<nStatementHandle>, <cSetting>)
 
  
 
==See Also==
 
==See Also==
[[CREATE CONNECTION]], [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLERROR()]], [[SQLEXEC()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]]
+
[[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLERROR()]], [[SQLEXEC()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]], [[SQLTRANSACTION()]]
 
+
  
 
==Description==
 
==Description==
The SQLGETPROP() function is used to query the property settings for a specified connection or for the current environment.
+
The SQLGETPROP() function is used to query the property settings for a specified connection or for the current environment.
 
+
 
The SQLGETPROP() function operates on the data source specified by <nStatementHandle>.
 
The SQLGETPROP() function operates on the data source specified by <nStatementHandle>.
  
 +
This function is not yet implemented.
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
!Keywords||Description
+
!width="30%"|Keywords||width="70%"|Description
 
|-
 
|-
|nStatementHandle||The workarea in which the gateway data source is open.  Specifying 0 causes the SQLGETPROP() function to return the property setting for the environment.
+
|nStatementHandle||Statement handle to the connection.  Specifying 0 causes the SQLGETPROP() function to return the property setting for the environment.
 
|-
 
|-
 
|cSetting||The property setting to query.  For available property settings, please see [[SQLSETPROP()]].
 
|cSetting||The property setting to query.  For available property settings, please see [[SQLSETPROP()]].
 
|-
 
|-
 
|}
 
|}
 
  
 
====Return values:====
 
====Return values:====
  
 
+
{| class="wikitable" width="100%"
{| class="wikitable"
+
!width="30%"|Return Value||width="70%"|Description
!Return Value||Description
+
 
|-
 
|-
 
|<expression>||The queried property setting
 
|<expression>||The queried property setting
Line 40: Line 35:
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
nStatHand = SQLSTRINGCONNECT("mysql@linux1:user1/pass1-database1.tcpip",.T.)
+
nStatHand = sqlconnect("awhr")
 
if nStatHand < 1
 
if nStatHand < 1
   dialog box [Could not connect]
+
   messagebox("Cannot make connection", 16, "SQL Connect Error")
 
else
 
else
   eGetProp = SQLGETPROP(nStatHand,"ConnectString")
+
   eGetProp = sqlgetprop(nStatHand,"ConnectString")
 
   if type("eGetProp") = "N" and eGetProp < 0
 
   if type("eGetProp") = "N" and eGetProp < 0
     dialog box [Error Occurred]
+
     messagebox("Error Occurred")
 
   else
 
   else
     dialog box etos(eGetProp)
+
     messagebox(etos(eGetProp))
 
   endif
 
   endif
 
endif
 
endif
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:SQL]]
 
[[Category:SQL]]
[[Category:Remote Data Connectivity Functions]]
+
[[Category:ODBC Functions]]
 +
[[Category:SQL Functions]]
 +
[[Category:VFP Not Implemented]]

Latest revision as of 12:44, 5 March 2013

Purpose

Query property settings for a connection or the environment

Syntax

SQLGETPROP(<nStatementHandle>, <cSetting>)

See Also

SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLDISCONNECT(), SQLERROR(), SQLEXEC(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLSTRINGCONNECT(), SQLTABLES(), SQLTRANSACTION()

Description

The SQLGETPROP() function is used to query the property settings for a specified connection or for the current environment. The SQLGETPROP() function operates on the data source specified by <nStatementHandle>.

This function is not yet implemented.

Keywords Description
nStatementHandle Statement handle to the connection. Specifying 0 causes the SQLGETPROP() function to return the property setting for the environment.
cSetting The property setting to query. For available property settings, please see SQLSETPROP().

Return values:

Return Value Description
<expression> The queried property setting
–1 Connection error
–2 Environment error

Example

nStatHand = sqlconnect("awhr")
if nStatHand < 1
  messagebox("Cannot make connection", 16, "SQL Connect Error")
else
  eGetProp = sqlgetprop(nStatHand,"ConnectString")
  if type("eGetProp") = "N" and eGetProp < 0
    messagebox("Error Occurred")
  else
    messagebox(etos(eGetProp))
  endif
endif