Editing versioned data in Informix using multiversioned views and SQL

You can edit versioned attribute data in a geodatabase in IBM Informix by editing a multiversioned view created on the data. Beginning with ArcGIS 10 SP2, there are two ways you can do this: editing a named version or editing the DEFAULT version. See A quick tour of editing versioned data using SQL for a description of each editing model.

There are several stored procedures installed with ArcSDE that help you work with multiversioned views to edit a named version (versions other than DEFAULT). These components and their descriptions are as follows:



Syntax and description


Creates a named geodatabase version.

If you are editing named versions, always edit your own, separate version; multiple editors cannot edit the same version using multiversioned views.

Do not use this procedure if you are editing the DEFAULT version.

EXECUTE FUNCTION sde.create_version ('<parent_version>', '<child_version>', <name_rule>, <access>, '<description>'

<parent_version> is the version from which your version is created.

<child_version> is the name for the version you are creating.

<name_rule> indicates whether the name specified for the version should be taken as given (2), or a unique name should be created when a duplicate name is specified (1).

<access> is the permission level for the version: 0 for Private, 1 for Public, or 2 for Protected.

<description> is a text description of the child version.


Set which geodatabase version and state you will access.

Do not use this procedure if you are editing the DEFAULT version.

EXECUTE FUNCTION sde.set_current_version('<version_name>')

<version_name> is the geodatabase version


Start and end an edit session on a named version.

Edits in the transaction are committed whenever this procedure is called.

EXECUTE FUNCTION sde.edit_version('<version_name>',1)

Specify 1 to start the edit session. Specify 2 to end it.


Delete a named geodatabase version.

EXECUTE FUNCTION sde.delete_version('<version_name>')

When you edit versioned tables through multiversioned views, changes are made to the delta tables, and row ID (ObjectID) values for new records are automatically generated. However, unlike editing versioned data in an ArcGIS edit session, no internal version reconciliation is done with these edits.

  • Version management operations, such as reconciling, resolving conflicts, and posting, must be done using ArcGIS software.
  • Never use database management system (DBMS) tools to update any row ID (ObjectID) field maintained by ArcGIS in the database. These ObjectID fields are allocated and managed by the geodatabase and, therefore, should not be altered using SQL.

If you want to edit the DEFAULT version, create a multiversioned view, then edit that view using SQL. Do not set the version or start an edit session to edit the DEFAULT version. Be sure to commit changes to the database after each edit; exclusive locks are held on the delta tables until you commit, thereby closing the transaction.

The following steps guide you through editing a named geodatabase version. In the examples, the multiversioned view created to perform the edits on the table is code_mv, and the version created and used for editing is mvedits.

  1. At an MS-DOS (Windows) or shell (UNIX or Linux) command prompt, execute the sdetable utility to create a multiversioned view.
    sdetable –o  create_mv_view –T code_mv 
    –t code_enf –i sde:informix –D code –u sarja –p not4U
  2. Create a new version in which to perform your edits.
    EXECUTE FUNCTION sde.create_version ('sde.DEFAULT', 'mvedits', 1, 1, 'multiversioned view edit version')
  3. Set the version for the edit session to the child version you just created.
    EXECUTE FUNCTION set_current_version('mvedits')
  4. Start an edit session by executing the edit_version function and specifying 1. The 1 indicates that an edit session should be started.
    EXECUTE FUNCTION sde.edit_version('mvedits',1)
  5. Perform the first edit to the multiversioned view using SQL.

    In this example, an existing record is updated.

    UPDATE code_mv 
    SET propowner = 'C. Industry' 
    WHERE vid = 2233

  6. Perform the next edit to the multiversioned view using SQL.

    In this example, a new record is inserted.

    INSERT INTO code_mv 
    (567, 'Anjo Badsu', ST_PointFromText('point (40 40))', 12)
  7. Execute a COMMIT or ROLLBACK statement.
  8. Stop the edit session by executing the edit_version function, but this time, specify 2.

    The 2 indicates that the edit session should be closed.

    EXECUTE FUNCTION sde.edit_version('mvedits',2)

  9. When all editing is done, reconcile and post edits through ArcGIS Desktop, then delete the geodatabase version you created in step 2. Or, if you decide you do not want the changes, you can delete the version you created in step 2 without reconciling and posting the edits.
    EXECUTE FUNCTION sde.delete_version('mvedits')

Related Topics