Querying a Public Window in C/C++

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:

/* 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); 
} 
...