English

How To: Obtain a version tree in SQL*Plus using SQL in Oracle

Summary

Instructions provided describe how to generate a version tree in SQL*Plus by executing a SQL statement.

Procedure

The SQL statement's output generates a version tree or hierarchy of parent/child versions, where the sde.DEFAULT version is the root to all other versions.

An example of a version's parent/child relationship is when a version is created from the DEFAULT version. The newly created version is a child version, and the newly created version's parent version is the DEFAULT version.

  1. In Oracle's SQL*Plus, execute the following hierarchical SQL statement as the SDE user to generate a version tree.

    Code:
    SQL> SELECT LPAD(' ',2*level-1)||(name) "Version Tree"
    2 FROM sde.versions START WITH name = 'DEFAULT'
    3 CONNECT BY PRIOR version_id = parent_version_id;

    Version Tree
    -------------------------------------
    DEFAULT
    MAPPING_DEFAULT
    WORKORDER_I0C6531
    WORKORDER_I910313
    DESIGN_F831
    DESIGN_F831_ALTERNATIVE_1
    DESIGN_F831_ALTERNATIVE_2
    LANDBASE
    EDITOR_TB
    EDITOR_EH
    EDITOR_SM

    The output shows the DEFAULT version as the root node, the MAPPING_DEFAULT and LANDBASE versions as child versions off the DEFAULT version (indented by two spaces), and then each of those version's child versions.