Use the SQL Transform to XML Schema builder to generate an XML schema that describes the XML data that is generated by an SQL Transform to XML builder.

Use the SQL Transform to XML Schema builder to generate an XML schema that describes the XML data that is generated by an SQL Transform to XML builder.

The SQL Transform to XML builder transforms a result set obtained from an SQL Statement. The generated schema can then be used to drive other builders at design-time, such as the Data Page builders.

This builder scans the model in which it resides, locates instances of all the other SQL builders, and then makes these builders available as input choices for use in defining how a schema should be constructed. When you use this builder, you select a specific combination of a DataSource, an SQL Statement, and an XML Transform to be used in generating the schema. You can create this combination by manually choosing each individual SQL builder, or you can select a single SQL Transaction step that defines the DataSource, statement, and transform to use.

This builder has no execution-time functionality. Instead, you use it to generate a schema at either design time or when the model in which the builder resides is generated on the server.

You can also opt to freeze the state of a schema. For example, you might iteratively regenerate a schema as needed in the IBM® WebSphere® Portlet Factory Designer. When the schema is stable, in the Generate Schema input, select the Only When SQL Builder Changes Are Detected option to lock this schema definition. On subsequent generations, if no changes are found, this builder restores a saved copy of the schema rather than create a new one. This option saves processing time.

Datasource configuration issues

In some cases, the configuration of the datasource on the application server might cause problems for this builder. For example, if the datasource provides a caching or prefetch setting such as Row Prefetch Enabled, this builder returns an SQL exception as it tries to access the datasource. To solve this problem, you can disable prefetch functionality on the datasource.

Quick tips

You can view the generated schema by looking for a special WebApp variable created by the builder. The variable takes its name from the value given to the Schema Variable Name input of the selected SQL Transform. If this input is blank, the schema is placed in a variable named: selected-sql-transform-builder-nameSchema.

If an error occurs during schema generation, the builder creates a status variable in the web application that holds diagnostic information about what went wrong. The variable has a name of selected-sql-transform-builder-nameSchemaStatus.

Schema generation takes place on the application server. You need to have your application server running and configured to support the selected DataSource.