Detailed description of function Retrieve

Source: Internet
Author: User

Function: Retrieves data for datawindow or datastore. Before using this function, you should have executed settransobject or settrans, and SET transaction objects for the data window. Before executing the function, clear the existing data in the data window, and then retrieve the data in the database to the data window. Therefore, if you want to append the retrieved data to the data window, you need to write a program. 2 is returned in the retrievestart event of the data window object to prevent the existing data in the data window from being cleared.
Function Syntax: Long dwcontrol. Retrieve ({any argument, any argument ...})
Ldwcontrol: data window, datastore, or drop-down sub-data window.
Largument: optional parameter, depending on the definition in the data window object. The number and Data Type of parameters must be consistent with the definitions in the data window object.
Return Value: Number type, indicating the number of rows displayed in the data window after the function is executed. Note that the returned value does not indicate the number of retrieved data rows. There are two points: whether scripts are written in retrievestart and whether filter rules are specified in the data window object definition. If a filter rule is defined in the data window object, data that does not comply with the filter rule is automatically moved to the filter buffer in the data window after the search is completed, the Return Value of the function is the total number of data rows retrieved after deducting the number of data rows moved to the Filter Buffer. Note that only the filter rules defined in the data window object affect the return value of the retrieve function, and the setfilter and filter functions do not.
Code example:
Example 1: The following program displays the prompt information based on the return value of the retrieve function.
Long ll_rows

Dw_main.settransobject (sqlca)
Ll_rows = dw_main.retrieve ()
If ll_rows <1 then MessageBox ("error", "No data is retrieved. ")
Example 2: search with parameters.
The SQL statement of the data window object is as follows:
Select name, EMP. Sal, sales. RGN from employee, sales
Where EMP. SAL>: an_salary and sales. RGN =: as_region
Here, an_salary and as_region are search parameters, which are numeric and numeric respectively. You can use the following syntax to retrieve data:
Dw_1.retrieve (50000, "nw ")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.