PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Retrieving the value of a column
  • Transferring the content of the query into a table
  • Retrieving Float items on Oracle (via ODBC)
  • Using tabulations in the items
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
Automatically associates each column of the query result with a control or with a variable of the application. Once SQLAssociate has been run, the result of the query must be browsed: the assignment of the controls or variables will be performed for each record read.
Note: This function must be used during a "SQLFirst/SQLCol" browse. See Types of SQL browse for more details.
Versions 19 and later
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
New in version 19
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
Android Widget This function is now available in Android Widget mode (accessing the external databases via a Webservice).
Android This function is now available for the Android applications (accessing the external databases via a Webservice).
iPhone/iPad This function is now available for the iPhone/iPad applications (accessing the external databases via a Webservice).
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
ResExec is boolean
ResExec = SQLExec("SELECT CUSTNAME,ADDR1,ADDR2,CITY,ZC FROM INV", "QRY2")
IF ResExec = True THEN
        SQLAssociate("QRY2", CustName, Addr[1], Addr[2], City, ZipCode)
        SQLFirst("QRY2")
ELSE
        // Processes the error
END
SQLClose("QRY2")
Syntax
SQLAssociate(<Query Name> , <List of Operators>)
<Query Name>: Character string (with or without quotes)
Name of query created and run by SQLExec (the query name must be enclosed in quotes), or run by SQLExecWDR (with or without quotes).
Java Only the queries created and run by SQLExec can be used in this version.
<List of Operators>: Character strings (with or without quotes), separated by commas
List of control names or variable names that will be automatically associated with the corresponding columns of the query (up to 250). These operators are separated by commas. The order of these operators must correspond to the order of the query columns.
Remarks

Retrieving the value of a column

The value of a column can be retrieved individually by SQLCol.
WINDEVWEBDEV - Server codeJavaAjaxHFSQLHFSQL Client/ServerOLE DBODBCNative Accesses

Transferring the content of the query into a table

To transfer the entire content of the query into a table, use SQLTable.
WINDEVWEBDEV - Server codeJavaAjaxODBCNative Accesses

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")

Using tabulations in the items

The SQL functions are used to insert tabulations into the items of the data files. The management of tabulations depends on the access mode used.
1st case: Running a query in ODBC:
When running a query in ODBC, the tabulations are not retrieved by SQLAssociate. To retrieve the value of items (with TAB characters), we recommend that you use a SQLFetch/SQLGetCol browse.
Example: SQLAssociate and the tabulations in the items
The items of the records to retrieve are as follows:
Item 1Item 2
Record 1JohnSmith
Record 2John + tab + MacDoughnut
For the first record:
  • SQLAssociate(Qry1, Var1, Var2): retrieves John and Smith
For the second record:
  • SQLAssociate(Qry1, Var1, Var2): retrieves John and Mac, but Mac does not correspond to the value of the second item
  • SQLAssociate(Qry1, Var1, Var2, Var3): retrieves John, Mac, Doughnut
2nd case: Running a query by OLEDB, HFSQL or Native Access
The tabulations found in the result items are automatically retrieved by SQLAssociate.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment