The Sybase CEP C/C++ SDK includes a way to register a query.
Registering a query includes:
Creating the streams specified in the registered query.
Creating the statements specified in the registered query.
Compiling the CCL statements.
Loading the query into the server.
Connecting ("binding") the stream names in the CCL statements to the URI's of existing streams, or creating new streams.
Starting execution of the query.
To register a query, use the C8RegisterQuery() function.
You must use a C8StreamInfo object to specify information about each of the streams used in the query. The information about each stream must include the following:
The name of the stream as used in the query.
Whether the stream is used as output stream, input stream, or local stream.
The CCL URI of the stream (for input or output streams only).
The project whose streams are bound by the registered query binds must be up and running for the C8RegisterQuery() function to succeed.
If databases or user-defined extensions are used in the queries, the databases and extensions must be configured in the server and in the compiler for the query to work properly.
The query can use any of the streams in a project (query module) as well as any streams the query defines locally. The only restriction is that the local streams must be defined in such a way that the CCL compiler can deduce their schemas automatically. Also, the streams defined locally for this query are not available in any other queries. The query can also create new input streams and output streams.