Home > database >  Query question
Query question

Time:10-04

Conditions query and I'm doing a full table query, after completion of a full table query (conditions will be set to null), then do condition query can be realized, and then do a full table query, (conditions will be set to null), the results did not change, or conditions of the query results
This is what ink reasons

CodePudding user response:

Code?

CodePudding user response:

Code a lot o
The reason why you idea is there

CodePudding user response:

String strl_bracket strlisting, stroprater strtar_date, strr_bracket, strconn, str_sqlcondition
Integer in_row, I, j, ll_i ll_j
String ls_coltype
In_row=dw_1. Rowcount ()
Ll_j=upperbound (ist_dwColumn s_columns)
For I=1 to in_row
Strl_bracket=dw_1. GetItemstring (I, "l_brackets")
Strlisting=dw_1. GetItemstring (I, "listing")
Stroprater=dW_1. Getitemstring (I, "oprate")
Strtar_date=dw_1. Gettext ()
Strr_bracket=dW_1. Getitemstring (I, "r_brackets")
Strconn=dW_1. Getitemstring (I, "conn")
If isnull (strl_bracket) or strl_bracket="' then
Strl_bracket=""
End the if
If isnull (strlisting) or strlisting="' then
Strlisting=""
End the if
If isnull (stroprater) or stroprater="' then
Stroprater=""
End the if
If isnull (strtar_date) or strtar_date="' then
Strtar_date=""
End the if
If isnull (strr_bracket) or strr_bracket="' then
Strr_bracket=""
End the if
If isnull (strconn) or strconn="' then
Strconn=""
End the if
For ll_i=1 to ll_j
String strcolumn
The integer ll_m, ll_n
Ll_m=ls_ddlb [ll_i] rowcount
For ll_n=1 to ll_m
Strcolumn=ls_ddlb [ll_i] datavalue [ll_n]
If strlisting=strcolumn then
Ls_coltype=ist_dwcolumn. S_columntype [ll_i]
The exit
End the if
Next
If strlisting=strcolumn then
The exit
End the if
Next
Choose a case ls_coltype
Case "date"
If isdate (strtar_date) then
Strtar_date="date ('" + strtar_date + ") "
The else
Messagebox (' message ', 'the first' + string (ll_i) + 'lines of data cannot be verified, please input again')
End the if
Case "char (10)
"If stroprater='like' or stroprater='not like' then
If pos (stroprater, '%')=0 then
Strtar_date="' % %" + strtar_date + "'"
The else
Stroprater="'" + stroprater + "'"
End the if
End the if
If stroprater='=' then
Strtar_date="'" + strtar_date + "'"
End the if
Case "deci", "numb", "int", "long", "real", "doub
"If strtar_date="' then
Strtar_date='0'
End the if
If not isnumber (strtar_date) then
Messagebox (' message 'and' data cannot be verified)
Return
End the if
If stroprater='in' or stroprater='not' in then
Strtar_date strtar_date="(" + +") "
End the if
The END CHOOSE
Str_sqlcondition=strl_bracket + strlisting + stroprater + strtar_date + strr_bracket + strconn
Next
If isnull (str_sqlcondition) or str_sqlcondition="" then
Str_sqlcondition=""
End the if
Dw_2. Settransobject (sqlca)
If the sqlca. Sqlcode<> 0 then
The rollback.
The else
Dw_2. Retrieve ()
Dw_2. Setfilter (str_sqlcondition)
Dw_2. Filter ()
End the if

CodePudding user response:

Dw_2. Setfilter (str_sqlcondition)

The full table when dw_2. Setfilter (str_sqlcondition)
To: dw_2 setfilter ()
, reoccupy dw_2 conditions. Setfilter (str_sqlcondition)

Have a try
  • Related