Modifying the Query: Exercise

Explore additional filter capabilities with Sybase CEP Engine.

The project as it stands now only filters based on a single value of a single column. However, much more sophisticated filtering can be accomplished with Sybase CEP Engine.

Complete the following exercises to explore additional capabilities. See Solutions for possible solutions to these exercises.

  1. Insert "OR Symbol = 'SWY'" before the semi-colon at the end of the Query statement so that the last line looks like this:
    WHERE Symbol = 'EBAY' OR Symbol = 'SWY';
    

    What do you expect the output of this query to be? Run the modified query and verify your expectations.

  2. Modify the query to filter for each of the following combinations. Run the project after each modification and note the results. (For more information about operators, see "Operators" in the Sybase CEP CCL Reference Guide .)
    • Rows with "MRK" in the Symbol column, Volume greater than 400, and Price less than 34.

    • Rows with "EBAY" or "MRK" in the Symbol column and Volume greater than 1000 but less than 3000.

    • Rows with the product of Price and Volume no more than 3000.

Next

Questions

Answer the following questions to reinforce the information presented in this tutorial. See Solutions for answers to these questions.

  1. What is the purpose of Sybase CEP Environments and Workspaces? What is one significant difference between the two?

  2. What Sybase CEP component translates data from an external format to one that Sybase CEP Engine can process (or vice versa)? How do you associate such a component with a stream?