Various components can query public windows, including Sybase CEP Projects, SDKs, and the Sybase CEP public windows ODBC driver.
The Sybase CEP Server public window feature enables the rows in a window to be queried by any of the following:
A separate project running on a Sybase CEP Server that can query the public window using a database subquery or the CCL database statement. See "Database Statement" and "Database Subquery" in the Sybase CEP CCL Reference Guide for more information.
An application written using one of the Sybase CEP SDKs.
The Sybase CEP-provided ODBC driver for public windows.
For more information about public windows, see "Public Windows" in the Sybase CEP CCL Reference Guide .
If you wish to access the public window from another Sybase CEP project, configure the Sybase CEP Server performing the query so that the server can access the public window as though it were a table in a remote database. This is necessary even if the project with the query and the project with the public window are on the same Sybase CEP Server. Specifically, create a database service entry in the c8-services.xml file; this makes the public windows in the project look like a service that the Database Statement or a database subquery can access. For information about the c8-services.xml file and its PublicWindow entries, see the Sybase CEP Installation Guide .
The following Sybase CEP SDKs enable you to write a program to read from a public window:
Sybase CEP C/C++ SDK. For more information, see Querying a Public Window on page 268.
Sybase CEP Java 1.5 SDK. For more information, see Querying a Public Windowon 298.
Sybase CEP .NET3 SDK. For more information, see Querying a Public Windowon page 311.
To query a public window using an SDK, call an SDK function and supply a query written using Sybase CEP SQL syntax. See "Sybase CEP SQL" in the Sybase CEP CCL Reference Guide for information about the syntax. The SQL statement must be a SELECT statement, and you must submit only one statement per query. The function returns a result set containing zero or more rows. You can then access each individual row in the result set.
Test the Sybase CEP SQL query from inside Sybase CEP Studio before using it in an SDK call. This is especially important for SDK calls that use the Query Public Windows in Module command on the Debug menu.
Sybase CEP Server includes an ODBC driver for use with public windows. When you set up a new User DSN for the Sybase CEP Public Windows ODBC driver, you provide the ccl URI of the project containing the public window. The URI is in the form ccl://host:port/Project/workspace/project_name, where workspace is the name of the Workspace in which the project runs, and project_name is the name of the project. For example:
ccl://mymachine:6789/Project/Default/Filter
When you execute a query against the public window, provide the name of the window.
The Sybase CEP Public Windows ODBC driver provides the core level of ODBC compliance, as defined by Microsoft athttp://msdn.microsoft.com/en-us/library/ms714086(VS.85).aspx.
As you design a system that uses public windows, remember that storing and updating public windows requires Sybase CEP Server to consume both memory and CPU cycles. You may see a reduction in the performance of other queries when you add public windows or add queries of public windows.