Defining a Stream Schema

Define your input schema in order to specifiy the format of the data in it.

Data in a Sybase CEP stream is formatted in rows and columns, similar to database tables. Each stream requires a schema definition, which specifies the format of the data in it.

Follow these steps to modify the default schema of your input stream:

  1. Click StockTrades in the Explorer view and then click the Schema tab in the Properties view:


    SFInstreamNewSchema

    The Schema tab shows the default schema containing a single column of type String.

  2. Replace "ColumnName" with "Symbol" in the Name text box, and then click somewhere outside that box. Sybase CEP Studio updates the Queries tab to match:

    SFInstreamSchemaNew

  3. Click the Insert column button (labeled with a plus sign) in the Schema tab.
  4. Type "Price" into the Name text box and then click Float in the Type list.
  5. Add a third column named Volume of type Integer. Your schema definition should look like this:

    SFInSchemaDone

    And the Queries tab should look like this:


    SFInSchemaCCL PNG

    The UI controls in the Schema tab are for convenience, and you can simply enter the CCL text into the Queries tab directly if you prefer.

    Note: Sybase CEP Studio automatically saves changes as they are made, eliminating the need to save your project explicitly.