Discovering a Schema

Use the Schema Discovery button in the Visual editor to discover and (automatically) create a schema based on the format of the data from the adapter.

Prerequisites
For a database adapter, you must have access to the database from the system where you are using SAP Sybase ESP Studio, and an entry for it in the service.xml file. Add the adapter to the diagram.
Task
In the SAP Sybase ESP Authoring perspective:
  1. Configure the adapter for schema discovery. In the adapter shape, click Edit Properties adapter_in and complete the dialog:
    • Select Use named property set and select a property set from the drop down menu, or,
    • Select Consolidate adapter properties from 'Adapter Properties' dialog and enter property values in the Basic and (optionally) Advanced tabs. Required properties are in red.
    For example, to use schema discovery for the File CSV Input adapter, you need to first configure the Directory and File properties for the adapter, to specify the absolute path to the data files you want the adapter to read.
    Note: To create a named property set, edit adapter properties in the project configuration file.
  2. Click Schema Discovery find.gif on the adapter toolbar.
    • If the schema is successfully discovered, a dialog appears where you can view and select a schema.
    • If the schema is not successfully discovered, an error message appears stating that no schema was discovered for the adapter. You can:
      • Check that the adapter properties are configured for schema discovery.
      • Check to see if the adapter supports schema discovery.
  3. Select a schema, and click Next.
  4. In the dialog for creating an element, select an option.
    Adapter State Available Options
    The adapter is not attached to a stream or window.
    • Create a new input stream (with inline schema). – Creates and attaches a new stream to the adapter, creates an inline schema for the stream, and populates the stream with the schema discovered from the adapter.
    • Create a new input window (with inline schema). – Creates and attaches a new window to the adapter, creates an inline schema for the window, and populates the window with the schema discovered from the adapter.
    • Create a new input stream (with attached schema). – Creates and attaches a new stream to the adapter, creates and attaches a new named schema to the stream, and populates the stream with the schema discovered from the adapter.
    • Create a new input window (with attached schema). – Creates and attaches a new window to the adapter, creates and attaches a new named schema to the window, and populates the window with the schema discovered from the adapter.
    • Create a new named schema. – Creates a new named schema and populates it with the schema discovered from the adapter.
    The adapter is already attached to a stream or window.
    • Apply the schema to the connecting stream or window. – Populates the stream or window with the schema discovered from the adapter.
    • Create a new named schema. – Creates a new named schema and populates it with the schema discovered from the adapter.
  5. Click Finish.
    • The mapping file you specified in the Adapter Mapping File property is populated with mappings based on the schema you selected.
    • Either the window or stream that is attached to the adapter is populated with the schema you selected or a new named schema is created in the project to which the adapter is attached.
  6. (Optional) Create or modify a mapping of adapter columns to ESP columns.
    1. In the adapter shape, click Edit Properties adapter_in.
    2. In the Adapter Properties screen, click the Advanced tab.
    3. Click the Value column of the Field Mapping row.
      The system displays an ellipsis in that field.
    4. Click on the ellipsis.
      The system displays the Define Adapter Field Mapping (Permutation) screen.
    5. Click the ESP Column field next to the database column you want to map to an ESP column
      A down arrow is displayed, indicating a dropdown list of choices is available.
    6. Click the mouse in the entry field to display the dropdown list and select the ESP column to which you wish to map the database column.
    7. Clear the check boxes next to any database columns that you do not wish to map (only checked columns will be mapped) and click OK.
      Studio removes the dialog and redisplays the Adapter Properties screen with the new mapping in the Field Mapping Value column.
    8. You can also click Select All to place a check in all the database column check boxes or Remove All to remove the check from all of the check boxes.
Related concepts
Schema Discovery
Related reference
Adapter Support for Schema Discovery