PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Characteristics of the memory table
  • Closing a query
  • Using the Partial Fetch
  • The different types of queries
  • Retrieving Float items on Oracle (via ODBC)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Transfers the result of a query to a memory table (list box or combo box), with possibility of Partial Fetch (the result is retrieved by blocks of lines). In a "SQLFetch/SQLGetCol" browse, the transfer of information into the table will start from the current record.
Note: This function must be used to browse the result of the SQLFetch/SQLGetCol query. A fatal error occurs if this function is used in a SQLFirst/SQLCol browse. See Types of SQL browse for more details.
Java The partial fetch is automatically performed by the Java framework.
PHP SQLTable does not operate if the query contains binary memos. The binary memos must be processed separately (they must be saved by fSaveText for example).
Versions 18 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 18
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Transfer into table: retrieval without fetch
ResSQL = SQLExec("SELECT CUSTNAME, CUSTFIRSTNAME FROM INV", "QRY1")
IF ResSQL THEN
SQLTable("QRY1", TABLE_QryTab, "Customer name" + TAB + "First name", "30 20")
// Calculates the number of result records
NbRec is int = TableCount(TABLE_QryTab)
ELSE
// SQL error
END
SQLClose("QRY1")
WINDEVWEBDEV - Server codeReports and QueriesPHPAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Accesses
// Transfer into table: retrieve the first 25 ones
ResSQL = SQLExec("SELECT CUSTLASTNAME, CUSTFIRSTNAME, CITY FROM INV", "QRY1")
IF ResSQL THEN
// Get the first 25 lines only
SQLTable("QRY1", TABLE_QryTab, 25)
ELSE
// SQL error
END
SQLClose("QRY1")
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Accesses
// Transfer into table: retrieval by fetch
ResSQL = SQLExec("SELECT CUSTLASTNAME, CUSTFIRSTNAME, CITY FROM INV", "QRY1")
IF ResSQL THEN
// Retrieve by groups of 28 rows
WHILE SQLTable(28, "QRY1", TABLE_MYTABLE, "TitleCol", "90")
// Process  
ELSE
// SQL error
END
SQLClose("QRY1")
Syntax

Transfer into a memory table without Partial Fetch Hide the details

SQLTable(<Query Name> , <Name of Table Control> , <Maximum Number of Rows> [, <Title of Columns>] , <Width of Columns>)
<Query Name>: Character string (with or without quotes)
Name of query created and run by SQLExec (with quotes), or run by SQLExecWDR (with or without quotes).
Java The query name must necessarily be enclosed in quotes.
<Name of Table Control>: Character string
Name of the memory table where the query result will be displayed.
<Maximum Number of Rows>: Integer
Maximum number of rows displayed in the table. If this parameter is specified, the table will have a maximum of <Maximum Number of Rows> rows displayed, even if the query result has a greater number of rows.
<Title of Columns>: Optional character string
List of all the column titles found in the memory table. The different titles are separated by TAB characters. To specify the widths of the columns only, this parameter can correspond to an empty string ("").
<Width of Columns>: Character string
List of all the column widths, separated by a space character. To specify the titles of the columns only, this parameter can correspond to an empty string ("").
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)

Transfer to a memory table with Partial Fetch Hide the details

SQLTable(<Number of Lines in a Block> , <Query Name> , <Name of Table Control> [, <Title of Columns>] , <Width of Columns>)
<Number of Lines in a Block>: Integer
Number of lines included in a block for the Partial Fetch. Only this block of lines is loaded in memory, the following blocks are automatically loaded in memory in background task.
<Query Name>: Character string (with or without quotes)
Name of query created and run by SQLExec (with quotes), or run by SQLExecWDR (with or without quotes).
<Name of Table Control>: Character string
Name of the memory table where the query result will be displayed.
<Title of Columns>: Optional character string
List of all the column titles found in the memory table. The different titles are separated by TAB characters. To specify the widths of the columns only, this parameter can correspond to an empty string ("").
<Width of Columns>: Character string
List of all the column widths, separated by a space character. To specify the titles of the columns only, this parameter can correspond to an empty string ("").
Remarks

Characteristics of the memory table

The number of columns in the memory table must be sufficient to accept all the columns found in the query result.

Closing a query

A query is automatically closed:
  • once SQLTable has been run if the partial Fetch is not used.
  • as soon as the query result is entirely retrieved if the Partial Fetch is used.
WINDEVWEBDEV - Server codeReports and QueriesPHPAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Accesses

Using the Partial Fetch

The current retrieval stops as soon as SQLClose is called or as soon as the window containing the Table control is closed.
The Partial Fetch can be used on several queries at the same time.
WINDEVWEBDEV - Server codeReports and QueriesPHPAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBODBCNative Accesses

The different types of queries

SQLTable is used to associate a memory table with the queries created by SQLExec.
To associate the queries created in the query editor or by HExecuteSQLQuery with a memory table, use FileToMemoryTable.
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)ODBC

Retrieving Float items on Oracle (via ODBC)

By default, the decimal separator used for the Float items on Oracle is the dot. However, the ODBC driver returns the value by using the comma as decimal separator. The decimal places are lost when the value is assigned to a numeric control.
To avoid this problem, you must configure the decimal separator for the current connection:
// Connection to the Oracle database
SQLConnect("MyOracleDatabase", "User", "Pass", "", "ODBC")
// Request for changing the decimal separator
SQLExec("ALTER SESSION SET NLS_NUMERIC_CHARACTERS ='. '", "TempQry")
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Java wd230java.jar
Linux wd230obj.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment