A more popular way of querying in PB

Source: Internet
Author: User

Author: Xingda Computer technology company (www.study01job.com) Guo Baoli

The reason for this is that the query is simple, but the functionality is not weak. Ideas are as follows:

1. Construct a relatively general window, which is used to construct query conditions. A data window control is placed on the window, where the user can enter content, each input item as a query condition, a different item is connected with or, and is a fuzzy query. Only columns of character type are placed in the data window, and date types and numeric types can be placed individually in a window using a user object.

For example, the Data window has ' name ', ' Job type ', ' Graduate school ' and other columns. Users enter ' Guo ' in ' name ' and choose ' administration ' in ' jobs '; the query criteria that should be generated are:

(XM like ' Guo% ') and (gz = ' 1 ')

That is, all columns that use the Drop-down data window, Checkedbox, RadioButton, DDLB, and so on, form the query criteria with an equal sign. In addition, parentheses are used to connect each condition, which is necessary.

User objects are constructed fairly simply, providing a drop-down list box with a select operator that provides a single row editor for input values. Then write the function in the user object that returns the query criteria based on the user's input, which is the name of the current field.

2, to conduct inquiries. The above operation completes in a separate window, returning the query criteria specified by the user. The next step is how to use the query criteria for data query.

Here we use Setsqlselect to complete the query. The only point to note is that each time you get the SQL statement to the Data window, you should use the character handler function to truncate the WHERE clause, and then concatenate the user-grouped condition as the WHERE clause, then Setsqlselect, Settransobject, Retrieve can be.

The above query procedure is relatively simple, the implementation of no complex programming and design ideas, but because it is a business design a query interface for business operators to be more targeted, the operation of the industry is particularly simple, but the query function is still very strong, and is their daily work the most commonly used query. So, it's still more popular.

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.