Sybase CEP Server supports public windows, which you can query from outside the server.
Public windows are created with the CREATE PUBLIC WINDOW statement. For an overview of public windows, see Public Windows. For syntax and other information about the CREATE PUBLIC WINDOW statement, see Sybase CEP CCL Reference Guide .
The API functions for querying a public window are shown below:
Parameters:
i_mgr_uri: The URI of the server/manager.
i_workspace_name: The name of the workspace that contains the public window.
i_project_name: The name of the project that defines the window.
i_sql: A string that contains the text of the query to execute.
Returns: The result/set or NULL. The returned result/set needs to be destroyed with C8WindowQueryResultDestroy() .
Parameters:
i_mgr_uri: The URI of the server/manager.
i_workspace_name: The name of the workspace that contains the public window.
i_project_name: The name of the project that defines the window.
i_sql: A string that contains the text of the query to execute.
i_credentials: Credentials (user name and password).
Returns: The result/set or NULL.
Important: The returned result/set needs to be destroyed with C8WindowQueryResultDestroy() .
Parameters:
i_result: A valid pointer to a query result/set.
Returns: Nothing.
Parameters:
i_result: A valid pointer to a query result/set.
Returns: The result/set's schema if successful, NULL otherwise.
Parameters:
i_result: A valid pointer to a query result/set.
Returns: The number of rows in the result set.
Parameters:
i_result: A valid pointer to a query result/set.
i_pos: A valid row number. The number should be between 0 and C8WindowQueryResultGetSize() -1 (inclusive).
Returns: The requested message.
The message must be deleted with C8MessageDestroy() .
The following code provides an example of querying a public window:
/* Example: Query a public window */ ... /* Submit the query and get the result set */ C8WindowQueryResultSet *res = C8QueryWindow( "http://manager:12345", "Default", "MyPublicWindowProject", "SELECT * FROM MyPublicWindow" ); /* If there is a result set (res is not NULL)...*/ if (res) { /* Get the number of rows in the resultset */ C8SizeType row_count = C8WindowQueryResultGetSize(res); /* For each row/message in the resultset ... */ for (C8SizeType ii = 0; ii < row_count; ++ii) { /* Get the message out of the resultset */ C8Message *msg = C8WindowQueryGetRowByPos(res, ii); /* use the message here ... */ /* Destroy message when done using it */ C8MessageDestroy(msg); } /* destroy result set when it's no longer needed */ C8WindowQueryResultDestroy(res); } ...