Constructing an XML Document from Table Data

The Sybase WorkSpace SQL-to-XML mapping functions enable you to generate SQL that produces a result set in XML format.

  1. For the appropriate ASE connection profile and database, select the appropriate procedural object.
    Object How to select
    Stored procedure Expand the Stored Procedures folder, right-click the stored procedure, and select Edit.
    Trigger Expand the Tables folder, expand the table, and then expand the Triggers folder. Right-click the trigger and select Edit.
  2. In the Source page, place the cursor in the desired location within the SQL code, right-click and select Sybase_ASE_15.x > SQL/XML Wizard.

    You can also open the SQL/XML wizard from the ASE XML Services icon ASE XML Services icon on the toolbar.

  3. Select SQL to XML Mapping Functions.
  4. Modify the following input fields.
    Field Example
    Variable or Query Select Variable or Query.

    Variable – enter a variable or choose an existing variable. Variable names begin with "@".

    Query – construct a SQL query in one of two ways:


    • Enter a SQL query.

    • Click SQL to construct a query using Visual SQL.

    Output Select one of the following output types:
    • Schema

    • DTD

    • Result Set

    • All – output for schema, DTD, and result set

  5. If you selected All as an output type, provide input variables to store mapping results for result set, schema, and DTD output types.

    Once you have provided input variable names, click Next to continue.

  6. Specify the listed options for the output type or types you selected, and click Finish.
Related concepts
Mapping Functions
Related tasks
Generating XML Schema for Real-Time Messaging Services
Storing a Message to a Database

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com