Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > 3 3 3

CREATE XADATASOURCE TYPE

3
Use the CREATE XADATASOURCE TYPE statement to create a new XA-compliant 3data source type and create an entry for it in the sysxasourcetypes system catalog table. Only Dynamic Server supports this statement, which 3is an extension to the ANSI/ISO standard for SQL. 3
3

Syntax

3
3
Read syntax diagramSkip visual syntax diagram3>>-CREATE--XADATASOURCE TYPE--xa_type--------------------------->
3 
3      .-,------------------------.
3      V                     (1)  |
3>--(----| Purpose Options |------+--)--------------------------><
3 
3 3 3
Notes:
3
    3
  1. See page Purpose Options
  2. 3
3 333333333333333333
Element Description Restrictions Syntax
xa_type Name that you declare here for a new XA data source type Must be unique among XA data source type names in the sysxasourcetypes system catalog table Database Object Name, p. Database Object Name
3
3

Usage

3
3

The CREATE XADATASOURCE TYPE statement adds an XA-compliant data 3source type to the database.

3

Any user can create an 3XA data source type, whose owner-naming rules depend on the ANSI-compliance 3status of the database. Only a database that uses transaction logging can 3support the X/Open DTP XA Standard.

3

To create 3a data source type, you must declare its name and specify purpose functions and purpose values as attributes 3of the XA source type. Most of the purpose options that follow the source 3type name associate columns in the sysxasourcetypes system 3catalog table with the name of a UDR.

3

Both XA data source types and instances of XA data sources are specific 3to one database. To support distributed transactions, they must be created 3in each database that interacts with the external XA data source.

3

The following statement creates a new XA data source type called MQSeries, owned by user informix.

3
CREATE XADATASOURCE TYPE 'informix'.MQSeries(
3                           xa_flags    = 1,
3                           xa_version  = 0,
3                           xa_open     = informix.mqseries_open,
3                           xa_close    = informix.mqseries_close,
3                           xa_start    = informix.mqseries_start,
3                           xa_end      = informix.mqseries_end,
3                           xa_rollback = informix.mqseries_rollback,
3                           xa_prepare  = informix.mqseries_prepare,
3                           xa_commit   = informix.mqseries_commit,
3                           xa_recover  = informix.mqseries_recover,
3                           xa_forget   = informix.mqseries_forget,
3                          xa_complete = informix.mqseries_complete);
3

You need to provide one value or UDR name for each of the options listed 3above, but the sequence in which you list them is not critical. (The order 3of purpose options in this example corresponds to the order of column names 3in the sysxasourcetypes system catalog table.)

3

After this statement executes successfully, you can create instances of 3type informix.MQSeries. The following statement creates 3a new instance called informix.MenloPark of XA-compliant 3data source type informix.MQSeries:

3
CREATE XADATASOURCE informix.MenloPark USING informix.MQSeries;
3
3

Related Information

3
3

Related statements: CREATE XADATASOURCE, DROP XADATASOURCE, DROP XADATASOURCE TYPE

3

For information about how to enter purpose-option specifications, see Purpose Options.

3

For information on how to use XA data sources, see the IBM Informix DataBlade API Programmer's Guide.

3

For the schema of the sysxasourcetypes table, see 3the documentation notes to the IBM Informix Guide to SQL: Reference.

3
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]