Home > database >  PB beginner guide: real-time query some questions about data window.
PB beginner guide: real-time query some questions about data window.

Time:10-07

Design idea: when did not enter the relevant code, interface display all department code, enter the relevant department code, interface to display only the information department, the query can be multiple queries,
The first two have been made to implement, but there was a problem in the last step: each time only one query, so want to ask next everybody, how can you solve this problem?
Code:

The second query error prompt:

CodePudding user response:

Because you are the first after the check, the SQL data window has been changed you added behind the where condition ()
The second time you check added becomes two where the where clause for the SQL statement
Of course, an error

Don't recommend this way of lacing SQL statements directly,
Data window can be defined in the parameter variables, and can use dw_1 retrieve (ls_arg1 ls_arg2) this way to get the data

CodePudding user response:

reference 1st floor AndriyChoi response:
because you first after the check, the SQL data window has been changed you added behind the where condition ()
The second time you check added becomes two where the where clause for the SQL statement
Of course, an error

Don't recommend this way of lacing SQL statements directly,
Data window can be defined in the parameter variables, then can use dw_1. Retrieve (ls_arg1 ls_arg2) way to get the data


Thank you for your guidance
But data window again if I add parameters variable conditions, and then when I open the main window again will not display any data, my train of thought is to open the main window shows all of the data automatically, and then to inquire according to the result of the input, so the beginning not parameter variables in the data window, trying to add the parameter variables, and then open the main window will pop up when the input variable parameter data frames, ordered CLANNE nor any data, after that,

CodePudding user response:

Your way of thinking direction is not ideal,
Retrieve () is the pull data, which is read from the database, the database is usually open after pull once, and then add a refresh button, if the window is a long time, to pull a,
And filter only need to use the filter (), to have pull data filtering screening, rather than to Mr Khoja take data,

CodePudding user response:

reference aolixiaox reply: 3/f
your thinking direction is not ideal,
Retrieve () is the pull data, which is read from the database, the database is usually open after pull once, and then add a refresh button, if the window is a long time, to pull a,
And filter only need to use the filter (), to have pull data filtering screening, rather than to Mr Khoja take data,

Behind me yesterday also have considered the refresh button to restore the data window the idea of SQL statements, also built a refresh button event, but had no effect has been clicked
:

Then just try to modify the way by filtering, but the program has been prompt expression is invalid, please bosses see if I write code missing:

CodePudding user response:

Filter conditions, don't have to write the where, string type, however, be joining together '
no.Ls_filter="dept_code='" + dm +"' "

Such as dm 1001
If not, it is according to filter dept_code=1001
After stitching, can press filter dept_code='1001'

In addition, the filter (), don't need to retrieve (), the method calls, will be a data from the data Mr Khoja,
If this form is not updated very frequently, there is no needed to

CodePudding user response:

The easiest way to add a debugbreak () debugging have a look at the value of the variable ls_newsql

CodePudding user response:

Really don't recommend joining together the SQL data window, debugging is very trouble, it was 20 years ago, the use of the
The SQL data window can you write that: select * from dept_dict where dept_code=: dm or: dm='all',
At the time of window open can dw_1. Retrieve (' all ')


When the query can be like this:
String dm

Dm=ddlb_dept. Text
If dm='or isnull (dm) then dm=' all '
Dw_1. Retrieve (dm)

CodePudding user response:

reference 5 floor aolixiaox reply:
filter conditions, don't have to write the where, string type, however, be joining together '
no.Ls_filter="dept_code='" + dm +"' "

Such as dm 1001
If not, it is according to filter dept_code=1001
After stitching, can press filter dept_code='1001'

In addition, the filter (), don't need to retrieve (), the method calls, will be a data from the data Mr Khoja,
If this form is not updated very frequently, there is no the necessary


Thank you bosses guidance!

CodePudding user response:

refer to 7th floor weixin_43056928 response:
really don't recommend joining together the SQL data window, debugging very troublesome, this is 20 years ago, the use of the
The SQL data window can you write that: select * from dept_dict where dept_code=: dm or: dm='all',
At the time of window open can dw_1. Retrieve (' all ')


When the query can be like this:
String dm

Dm=ddlb_dept. Text
If dm='or isnull (dm) then dm=' all '
Dw_1. Retrieve (dm)


Thank you bosses, the guidance of new ideas! I was also considered in the SQL statement OR statements ways to define!
  • Related