Oracle CEP Visualizer Oracle CEP Tools

2 Basic Elements of Oracle CQL 2-1 2 Basic Elements of Oracle CQL This chapter contains reference information on the simplest building blocks of Oracle CQL statements.

2.1 Introduction to Basic Elements of Oracle CQL

The basic elements of Oracle CQL include: ■ Section 2.2, Datatypes ■ Section 2.3, Datatype Comparison Rules ■ Section 2.4, Literals ■ Section 2.5, Format Models ■ Section 2.6, Nulls ■ Section 2.7, Comments ■ Section 2.8, Aliases ■ Section 2.9, Schema Object Names and Qualifiers Before using the statements described in Part IV, Using Oracle CQL , you should familiarize yourself with the concepts covered in this chapter.

2.2 Datatypes

Each value manipulated by Oracle CEP has a datatype. The datatype of a value associates a fixed set of properties with the value. These properties cause Oracle CEP to treat values of one datatype differently from values of another. For example, you can add values of INTEGER datatype, but not values of CHAR datatype.When you create a stream, you must specify a datatype for each of its elements. When you create a user-defined function, you must specify a datatype for each of its arguments. These datatypes define the domain of values that each element can contain or each argument can have. For example, attributes with TIMESTAMP as datatype cannot accept the value February 29 except for a leap year or the values 2 or SHOE.Oracle CQL provides a number of built-in datatypes that you can use. The syntax of Oracle CQL datatypes appears in the diagrams that follow. If Oracle CQL does not support a datatype that your events use, you can use an Oracle CQL data cartridge or a user-defined function to evaluate that datatype in an Oracle CQL query. For more information, see: ■ Section 2.2.1, Oracle CQL Built-in Datatypes 2-2 Oracle Complex Event Processing CQL Language Reference ■ Section 2.2.2, Handling Other Datatypes Using Oracle CQL Data Cartridges ■ Section 2.2.3, Handling Other Datatypes Using a User-Defined Function ■ Section 2.3, Datatype Comparison Rules ■ Section 2.4, Literals ■ Section 2.5, Format Models ■ Section 2.8.2.1, How to Define a Data Type Alias Using the Aliases Element datatype::= variable_length_datatype::= fixed_length_datatype::=

2.2.1 Oracle CQL Built-in Datatypes

Table 2–1 summarizes Oracle CQL built-in datatypes. Refer to the syntax in the preceding sections for the syntactic elements. Consider these datatype and datatype literal restrictions when defining event types. For more information, see Creating Oracle CEP Event Types in the Oracle Complex Event Processing Developers Guide for Eclipse. Table 2–1 Oracle CQL Built-in Datatype Summary Oracle CQL Datatype Description BIGINT Fixed-length number equivalent to a Java Long type. For more information, see Section 2.4.2, Numeric Literals . BOOLEAN Fixed-length boolean equivalent to a Java Boolean type. Valid values are true or false. BYTE[size] 1 Variable-length character data of length size bytes. Maximum size is 4096 bytes. Default and minimum size is 1 byte. For more information, see Section 2.4.2, Numeric Literals .