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.

System-defined FunctionsThis rule holds true for more complicated expressions, as in the followingstatements:man_days = varchar(days) + 'days';if (start_date + man_days) > 'today' then/* processing statements */endif;If start_date or man_days is null, the entire boolean expression evaluates tonull and the processing statements are never performed.Expressions in SQL StatementsWhen using expressions in SQL statements in OpenROAD, the operands of thefunctions and operators (or the entire expression) may be literals or databasecolumn names. In contexts where correlation names are defined (for example,with the select statement), a column name may be preceded by a correlationname (separated from the column name by a period).You can replace any literal with a named constant or simple variable name (ora reference to a simple variable that is an attribute of a reference variable oran attribute of a row of an array variable) preceded by a colon. However, thefield function is not allowed in database statements, nor are procedure ormethod invocations. SQL function and operators are allowed (they areevaluated by the database).System-defined FunctionsOpenROAD supports the following functions:• All SQL functions except for the table_key and object_key scalar functions• A non-SQL function, the field functionThere are four types of SQL functions:• Scalar functions, which take single-valued expressions as their arguments,can be used in all OpenROAD statements and in all SQL statements thatare used within OpenROAD.• Aggregate functions, which take a set of values (for example, the contentsof a column in a table) as their arguments, can only be used in OpenROADwithin SQL statements.• The ifnull function• The dbmsinfo functionThese functions are described in the following subsections.50 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!