Using built-in qualifications  Using compare operation qualifications

Chapter 3: Building Production Objects

Built-in qualification functions

The following built-in qualification functions are available:


dbExist

Description

Verifies the existence of data in the specified collection file. Use this function before using the dbSelect built-in filter function when you cannot be certain if data is in a collection file.

Arguments

Must match the pattern string in the Qualification Object Information windows’s FldObj or Datalink field.


dbNotExist

Description

Verifies that data is not present in the specified collection file. Use this function before using the dbInsert built-in filter function to verify that there is no data in the collection file that the dbInsert operation would overwrite.

Arguments

Must match the pattern string in the Qualification Object Information windows’s FldObj or Datalink field.


isDate

Description

Performs a byte-by-byte comparison of the content in the Qualification Object Information windows’s FldObj or Datalink field to the date format specifiers in the argument string. If they match, the function returns true (1).

Arguments

Argument

Description

YY

The last two digits of the year.

YYYY

The year.

jjj

The Julian date (0 – 365).

JJJ

The for Julian date (1 – 366).

mm

The month (1 – 12).

dd

The day (1 – 31).

w

The day of the week (0 – 6).

W

The day of the week (1 – 7).

Any other character must match the data in the Qualification Object Information windows’s FldObj or Datalink field.

If the referenced object’s data contains at least the month and day, then isDate also verifies that the date is valid (for example, “9 – 31” is invalid). To verify leap year dates, the referenced object must contain the month, day, and year.

Because isDate compares each format specifier in the argument string to one byte of data in the referenced field or datalink object, the bytes of data must exactly match the format specifiers. For example, if the data for the month is “3” instead of “03”, use the “m” argument instead of the “mm” argument.

Examples


isMatch

Description

Compares the content of the Qualification Object Information windows’s FldObj or Datalink field to the argument string. If they match, the function returns true (1).

Arguments

Must match the pattern string in the Qualification Object Information windows’s FldObj or Datalink field.


isNotMatch

Description

Compares the content of the Qualification Object Information windows’s FldObj or Datalink field to the argument string. If they do not match, the function returns true (1).

Arguments

Must not match the pattern string in the Qualification Object Information windows’s FldObj or Datalink field.


isNotRegEx

Description

Checks the content of the Qualification Object Information windows’s FldObj or Datalink field for the regular expression in the argument string. If it is not present, the function returns true (1). You can use a simple literal or a UNIX-style regular expression.

Arguments

The regular expression in the Qualification Object Information windows’s FldObj or Datalink field.


isRegEx

Description

Checks the content of the Qualification Object Information windows’s FldObj or Datalink field for the regular expression in the argument string. If it is present, the function returns true (1). You can use a simple literal or a UNIX-style regular expression.

Arguments

The regular expression in the Qualification Object Information windows’s FldObj or Datalink field.

Because isTime compares each format specifier in the arguments string to one byte of data in the Qualification Object Information windows’s FldObj or Datalink field, the bytes of data must exactly match the format specifiers. For example, if the data for the minutes is “7” instead of “07”, use the “m” argument of mm. However, “xx” must always contain two characters, and “zzz” must always contain three-characters.

Examples

When you use the isRegEx() and isNotRegEx() qualification functions, the regular expression in the argument string can contain special symbols so the value matches a range of values in the data area.

Symbol

Description

[ ]

Brackets define a range of characters to match a single character position.

Example – “abc[def]g” matches “abcdg”, “abceg”, or “abcfg”.

.

A period matches any single character except newline.

Example – “abc.g” matches “abcag”, “abcbg”, “abccg”, and so on.

*

An asterisk matches any character or characters.

Example – “a*” matches “aa”, “a9”, “a+”, “az”, and so on.

^

A caret at the start of an expression causes a match only on the initial segment of a line. If the caret precedes a string in brackets, a match occurs on any character except the characters in the string and new line.

Example – “abc[^def]g” matches the same values as the expression “abc.g” except the strings “abcdg”, “abceg”, “abcfg” and “abc(newline)g”.

+

A plus sign following a regular expression means one or more times.

Example – “[1-5]+” is equivalent to “[1-5][1-5]*”.

$

A dollar sign as the last character of a regular expression anchors the expression to the end of a line. The strings that end in the expression's characters just preceding the $ fulfill the search criteria.

Example – “ab$” matches “erafxab” but not “abrefok”.

  • If the minus sign is in an expression in brackets, it indicates a string of consecutive values.

    Example – “[a-e]” is equivalent to “[abcde]”.

  • If the minus sign is the first or last character in brackets, it appears as itself.

    Example – “[-[]” matches the characters “-” and “[“.

{m} {m,} {m,u}

Integers that specify the number of times to apply the preceding regular expression. “m” is the minimum number and “u” is a number in the range of 0 – 255. The expression “{m}” by itself indicates the exact number of times the preceding regular expression is to be applied. The expression “{m,}” specifies “{m,infinity}”.

( )

Use parentheses to group other expressions. Operators like *, {}, and + can work on a regular expression enclosed in parentheses ( ) as well as on a single character.

\

You can use any of the above characters as their own value by preceding the character with a backslash. The backslash works on only one character at a time.

Example – “AB\.\*CD” resolves to the literal “AB.*CD”.

Examples





Copyright © 2005. Sybase Inc. All rights reserved. Using compare operation qualifications

View this book as PDF