Difference between revisions of "SQLTABLES()"

From Lianjapedia
Jump to: navigation, search
m (1 revision: SQL)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Store data source table names to a table
 
Store data source table names to a table
 
  
 
==Syntax==
 
==Syntax==
 
SQLTABLES(<nStatementHandle>[, <cTableTypes>] [, <cCursorName>])
 
SQLTABLES(<nStatementHandle>[, <cTableTypes>] [, <cCursorName>])
 
  
 
==See Also==
 
==See Also==
[[CREATE CONNECTION]], [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLERROR()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]]
+
[[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLERROR()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]]
 
+
  
 
==Description==
 
==Description==
Line 15: Line 12:
  
 
The SQLTABLES() function operates on the data source specified by <nStatementHandle>.
 
The SQLTABLES() function operates on the data source specified by <nStatementHandle>.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 29: Line 25:
  
 
cCursorName Table Columns:
 
cCursorName Table Columns:
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 45: Line 40:
 
|-
 
|-
 
|}
 
|}
 
  
 
====Return values:====
 
====Return values:====
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 62: Line 55:
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==
Line 90: Line 82:
 
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:Remote Data Connectivity Functions]]

Revision as of 05:57, 22 March 2012

Purpose

Store data source table names to a table

Syntax

SQLTABLES(<nStatementHandle>[, <cTableTypes>] [, <cCursorName>])

See Also

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

Description

The SQLTABLES() function is used to store table name information for a specified connection to a table.

The SQLTABLES() function operates on the data source specified by <nStatementHandle>.

Keywords Description
nStatementHandle The workarea in which the gateway data source is open
cTableType The table type or types to include. ’TABLE’, ’VIEW’ and ’SYSTEM_TABLE’ are all valid table types. If cTableType is omitted or empty, all types of table are included
cCursorName The name of the table to create. If cCursorName is not specified, the default name SQLRESULT is used. The table column information is shown in the table below

cCursorName Table Columns:

Column Description
TABLE_QUALIFIER Table qualifier id
TABLE_OWNER Table owner id
TABLE_NAME Table name
TABLE_TYPE Table type
REMARKS Table description

Return values:

Return Value Description
1 The cursor was created successfully
0 SQLTABLES() still executing

Example

nStatHand=SQLSTRINGCONNECT("mysql@linux1:user1/pass1-database1.tcpip",.T.)
if nStatHand < 1
  dialog box [Could not connect]
else
  // Store names for all table types to default results table
  nTabEnd = SQLTABLES(nStatHand)
  if nTabEnd = 1
    select sqlresult
    browse
  endif
endif
 
nStatHand= SQLSTRINGCONNECT("mysql@linux1:user1/pass1-database1.tcpip",.T.)
if nStatHand < 1
  dialog box [Could not connect]
else
  // Store names for specified table types to specified results table
  nTabEnd = SQLTABLES(nStatHand, "’SYSTEM_TABLE’,’VIEW’", "myresults")
  if nTabEnd = 1
    select myresults
    browse
  endif
endif