|
|
|
|
- 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
SQLAssociate (Function) In french: SQLAssocie Automatically associates each column of the query result with a control or with a variable of the application. Once SQLAssociate has been executed, it is necessary to loop through the query result: the assignment of the controls or variables will be performed for each record read. Remark: This function must be used during a "SQLFirst/SQLCol" browse. For more details on the different modes to loop through a query result, see Types of SQL browse.
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 Name of the query created and executed with SQLExec (the name of the query must be enclosed in quotation marks) or executed with SQLExecWDR (with or without quotation marks). <List of operators>: Character strings, 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. 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: Executing a query with ODBC:When executing a query with ODBC, SQLAssociate does not return tabs. To get the value of the items (with Tabs), use SQLFetch/SQLGetCol. Example: SQLAssociate and the tabulations in the items The items of the records to retrieve are as follows: | | | | Item 1 | Item 2 | Record 1 | John | Smith | Record 2 | John + tab + Mac | Doughnut |
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: Executing a query with OLEDB, HFSQL or a Native Connector SQLAssociate automatically retrieves the tabs in the result items.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|