However, it is best to use sysquery: valueemptystring () for future scalability of the system to avoid changing the meaning of null values in the future.
Sysquery: valueemptystring (); the comment on this method also shows that the reason for encapsulating vacant space into a method is for future compatibility.
When the value attribute of querybuildrange is used, if the value is '', the query ignores the range, as if there is no such range. For example, the following statement:
In this way, the same effect can be achieved.
Static void emptytest ()
{
Query Q;
Queryrun QR;
Custtable Cust;
;
Q = new query ();
Q. adddatasource (tablenum (custtable). addrange (fieldnum (custtable, accountnum). Value ('');
Qr = new queryrun (Q );
While (QR. Next ())
{
Cust = QR. Get (tablenum (custtable ));
Box: Info (Cust. Address );
}
Pause;
}
What should I do if I want to query a field whose value is? In this case, sysquery: valueemptystring (); is used as follows:
Static void emptytest ()
{
Query Q;
Queryrun QR;
Custtable Cust;
;
Q = new query ();
Q. adddatasource (tablenum (custtable). addrange (fieldnum (custtable, accountnum). Value (sysquery: valueemptystring ());
Qr = new queryrun (Q );
While (QR. Next ())
{
Cust = QR. Get (tablenum (custtable ));
Box: Info (Cust. Address );
}
Pause;
}
Static void emptytest ()
{
Query Q;
Queryrun QR;
Custtable Cust;
;
Q = new query ();
Q. adddatasource (tablenum (custtable). addrange (fieldnum (custtable, accountnum). Value (Queryvalue (''));
Qr = new queryrun (Q );
While (QR. Next ())
{
Cust = QR. Get (tablenum (custtable ));
Box: Info (Cust. Address );
}
Pause;
}
You can also directly use escape characters, such:
Static void emptytest ()
{
Query Q;
Queryrun QR;
Custtable Cust;
;
Q = new query ();
Q. adddatasource (tablenum (custtable). addrange (fieldnum (custtable, accountnum). Value ("/'/'");
Qr = new queryrun (Q );
While (QR. Next ())
{
Cust = QR. Get (tablenum (custtable ));
Box: Info (Cust. Address );
}
Pause;
}