PB commonly used Query method

Source: Internet
Author: User

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

The query program is an indispensable piece of functionality when we develop the application software project. So, here I prepare the system to summarize the query program's writing. First of all, introduce the common query technology, in the following article I will have a choice to give an example. I hope the article here for everyone's development has a relatively large practical value.

PB provides the following query means:

1, using setfilter and filter function;

2, the use of Querymode properties;

3, use function Getsqlselect, setsqlselect;

4, the use of Create, Syntaxfromsql.

In these ways, the 1th way is to provide a simpler query. Also, many beginners will be overwhelmed by the conditions of a date-type field. Usually we use this function when a single condition query or a query condition is relatively low.

My personal preference, never use the 2nd way, although it is simple programming, functional is also good. However, the interface of repeated switching, so that users feel a bit messy.

My personal favorite is the 3rd and 4th kinds. This way, the query conditions can be completely given to the user to construct, developers only need to provide an interface, using the interface can be flexible combination of a variety of query conditions; 4th, in addition to the query conditions can be given to the user to set up, you can also display the results of the query which columns also to the user to choose, very flexible. So, in my application, this generic query is essential.

However, the program is very generic, not necessarily users like. Because, sometimes the user's query is some of the more fixed way, may be in the one or two fields as a condition, the key is to use which are very uncertain, the one or two may come from multiple data tables. In this case, we need to do business analysis, according to the user's work characteristics to provide a fixed condition of the query, in a data window provides users often used to query the multiple fields, the user input to the field is equal to the input as a condition for the query, enter a number of these or the relationship between the query. Of course, we need to take into account the types of data and which tables come from. Although, in the implementation of skills, this program is not what we developers like, but the user is more like. Easy to use!

It's morning, ready to go to work. Tomorrow we will expand on the above topic, give a concrete implementation.

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.