HP 3000 Manuals

SPLIT [ HP IMAGE/SQL Administration Guide ] MPE/iX 5.0 Documentation


HP IMAGE/SQL Administration Guide

SPLIT 

Divides a mapped column into two or more smaller mapped columns.

Syntax 

SP[LIT] MapTable.MapCol 

INTO NewColSpec [,...]

Parameters 

MapTable      is the name of the mapped table containing the mapped
              column.

MapCol        is the name of the mapped column to be split into smaller
              units.

NewColSpec    is the specification of the new mapped column.  Repeat this
              parameter for each new mapped column.  The following syntax
              is used for the new mapped columns:

              NewMapCol:SourceType[:MappedType]

              NewMapCol     is the new mapped column name.  This name can
                            be up to 20 bytes in length and can be made
                            up of any combination of letters (A to Z),
                            decimal digits (0 to 9), $, #, @, or _
                            (underscore).  However, the first character
                            cannot be a decimal digit or an underscore.
                            (Note that lowercase letters are
                            automatically converted to uppercase
                            letters.)

              SourceType    is the TurboIMAGE/XL type the new mapped
                            column would have if it were a data item in a
                            TurboIMAGE/XL database.

              MappedType    is the new mapped column's SQL type.  Refer
                            to Table 2-6  for default and alternative
                            data type mappings.  If omitted, default type
                            mapping is supplied.

Prerequisites 

   *   SET SQLDBE issued.
   *   SET TURBODB issued.
   *   DBA authority.
   *   Database attached.

Description 

Use the SPLIT command to divide mapped columns into smaller units.  This
is sometimes necessary because one data item can be used to contain
information about several logically discrete units.

When a TurboIMAGE/XL database becomes part of a DBEnvironment, it is no
longer necessary to keep logically separate information in one mapped
column.  The SPLIT command can be used to divide mapped columns of this
kind into several smaller more logically discrete mapped columns.

Use the following guidelines when using the SPLIT command:

   1.  To use this command, you must first determine what each new mapped
       column's data type would be if it were a source field in a
       TurboIMAGE/XL database.

   2.  Each new mapped column must appear in the SPLIT command in the
       same order in which it is stored in the original source field.

   3.  Only certain data type conversions are allowed from TurboIMAGE/XL
       to SQL. Refer to Table 2-6  for recommended and alternative
       data type conversions.

   4.  The total length of the proposed new source fields must match the
       length of the original source field or an error message is issued.

It is desirable to split mapped columns before IMAGE/SQL users access the
attached database because when a mapped column is split, all user-created
views containing the mapped column are dropped.

Example 

The mapped column INVENTORY.PART_INFO is of type CHAR(60) and contains
the following units of information about parts in the order shown:

   *   A code identifying the part.
   *   The version number of the part.
   *   Brief listing of any special considerations regarding the part.

To split this mapped column into its logical units, issue the following
command:
____________________________________________________________
|                                                          |
|     >>SPLIT INVENTORY.PART_INFO INTO PART_ID_CODE:X4,&   |
|                                      PART_VERSION_NO:I1,&|
|                                      PART_NOTES:X54      |
|                                                          |
|     Updated information in table INVENTORY.              |
|     >>                                                   |
____________________________________________________________

            

In the above example, INVENTORY.PART_INFO is split into three mapped
columns.  No alternative data type mapping exists for the specified data
types.  Therefore, it is not necessary to specify the :MappedType 
parameter because in this case the mapped types default to the following
types:

   *   PART_ID_CODE of type CHAR(4)
   *   PART_VERSION_NO of type SMALLINT
   *   PART_NOTES of type CHAR(54)

Note that the combined length of these three mapped columns equals the
total length of the original mapped column, INVENTORY.PART_INFO.



MPE/iX 5.0 Documentation