TurboDB Engine Documentation Filter Search-Conditions See also |
Previous Top Next |
Filter search-conditions are used, when entering check constraints for a TurboDB table via TurboDB Viewer or via the VCL TTdbTable component. They are very similar to TurboSQL search-conditions with a few exceptions:
• | Date, time and number formats are based on the local settings |
• | * and ? are allowed as jokers as well as % and _ |
• | Sets are written in brackets instead of parenthesis |
Examples
(Name, Amount, Amount1, Amount2 and Date-of-birth are table columns.)
Name = 'Smith'
Name like 'Smi*' (deprecated, prefer % in place of *)
Name like 'Smi%'
Name like 'Smit?' (deprecated, prefer _ in place of ?)
Name like 'Smit_'
Name has 'mit'
LeftStr(Name, 2) = 'Sm'
Length(Name) > 4
Amount = 13546.45
Amount < 13546.46
Amount < 345.67 or Amount > 567.89 (note that the decimal point depends on your local settings)
Amount1 * 0.3 > Amount2 * 0.8
Amount is not null (includes all records that have a value for Amount)
Date-of-birth = "4/20/1962" (note that the date format depends on your local settings)
Date-of-birth < "4/20/1962"
Date-of-birth between "4/1/1962" and "4/30/1962"
Year(Date-of-birth) = 1962
Date-of-birth is null (includes all records that have no value for Date-of-birth)
Rules for Quoting and Escaping
Both single and double quotes are allowed for string constants. If you need a quote within a string, which is terminated with the same kind of quote, duplicate the quote:
"My ""quote""" -> My "quote"
'My "quote"' -> My "quote"
'My ''quote''' -> My 'quote'
"My 'quote'" -> My 'quote'
If a table column has a name, which is also a keyword, you must precede it by $:
Length($Password) > 8
TurboDB offers powerful functions and operators for use in search-conditions, e.g. like, between...and..., LeftStr, Year and many others. Refer to Operators and Functions for a complete reference. Comparisons can be combined using the logical operators and, or and not.
Compatibility Information
TurboPL is supported only for backward compatibility in tables up to level 4.