10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Expressions• You can use the escape clause with square brackets to match any ofthe characters you specify. Typically, square brackets are treated thesame as any other regular characters. However, when preceded by theescape character, the brackets define a “match-any-of-thesecharacters”string.In the following example, you could use the escape clause with squarebrackets to match all strings ending with X, Y, or Z:name like '%\[XYZ\]' escape '\'As another example:name like '_\[BC\]C%' escape '\'This pattern matches “ABC,” “ACC,” “FCC Fairness Doctrine” and doesnot match “FDC Yellow #42” or “Access” (because “cc” is notuppercase).Finally, the following example matches any string beginning with a leftbracket and whose second character is “1,” “2,” “3” or a right bracket:name like '[\[123]\]' escape '\'The escape character cannot be followed in the pattern by anycharacter other than underscore, percent, left or right bracket, oranother escape character.Pattern matching characters have no effect in comparisons using thearithmetic operators. For example, consider a statement that begins asfollows:if name = 'Fred%' then ...The comparison tests the value of “name” to see whether it equals theconstant literal “Fred%.” In the event that it does, the object of thecondition is executed.Is [Not] Null OperatorThe is [not] null operator tests whether an expression is null. The syntax ofthis operator is:expression is [not] nullThe following code is an example:if salary is null thensal_msg = 'Salary amount is unknown.'endif;46 <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!