HP 3000 Manuals

UPDATE TYPE [ ALLBASE/Turbo CONNECT Administrator's Guide ] MPE/iX 5.0 Documentation


ALLBASE/Turbo CONNECT Administrator's Guide

UPDATE TYPE 

Updates data type mapping information.

Syntax 

              {              {*          }}
              {SourceType IN {MappedTable}}
U[PDATE] TYPE {IN                         }
              {MappedTable.Col            }
[TO NewMappedType]

Parameters 

SourceType        is a TurboIMAGE/XL data item type whose data type
                  mapping information you wish to update.  Use either
                  this parameter or the MappedTable.Col parameter.

* (asterisk)      indicates that you wish to update data type mapping for
                  a source data type in all mapped tables where it
                  occurs.  Use either this option or specify the
                  individual table to be updated.

MappedTable       is the name of a mapped table containing a data type
                  whose mapping you wish to update.  Use either this
                  parameter or the asterisk (*) option.

MappedTable.Col   is the name of a column in a specific mapped table
                  whose data type mapping you wish to update.  Use either
                  this parameter or the SourceType parameter.

NewMappedType     is the new data type you wish to assign.  If this
                  parameter is omitted, default ATCUtil data type mapping
                  is used.  (See Table 2-5 for allowed data type
                  mappings.)

Prerequisites 

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

Description 

Use the UPDATE TYPE command to update the data type mapping information
in one of the following situations:

 *  For all occurrences of a specified source data type in the database.
 *  For all occurrences of the source data type in a specified mapped
    table.
 *  For one occurence of the source data type in a particular column of a
    specified table.

To return the TurboIMAGE/XL data type or mapped column to default ATCUtil
data type mapping values, omit the TO NewMappedType parameter.

It is desirable to update data type mapping before Turbo CONNECT users
access the database, because when a mapped column is updated, all
user-created views containing these mapped columns are dropped.

UPDATE TYPE stores the new data type mapping information in the ATCINFO
file.  The DISPLAY MAP command reflects the updated type information.
Data type updates are restricted to those data types that have alternate
data type mapping.

Table 2-2 in chapter 2 summarizes Turbo CONNECT data type mapping
defaults and alternates.

Example 

In the following example, the UPDATE TYPE command is used to specify the
alternate mapping, ALLBASE/SQL CHAR(4).  This is a byte-by-byte transfer
(R2 is 4 bytes long).  No data conversion is performed.
______________________________________________
|                                            |
|     >>UPDATE TYPE R2 IN CUSTOMER TO CHAR(4)|
|     Updated information in table CUSTOMER. |
|     >>                                     |
______________________________________________

After the data type update, the DISPLAY MAP command reflects the change:
________________________________________________________________________________
|                                                                              |
|     >>DISPLAY MAP CUSTOMER                                                   |
|                                                                              |
|     TurboIMAGE/XL DB : SALES.SERED.ATC                                       |
|     DBEnvironment    : PARTSDBE.SERED.ATC                                    |
|     Owner Name       : SALES                                                 |
|                                                                              |
|     MAPPED(SOURCE)   SOURCE             MAPPED         SOURCE  MAPPED        |
|     TABLE            FIELD              COLUMN          TYPE    TYPE    NOTES|
|     ------------ ---------------- -------------------- ------- -------- -----|
|                                                                              |
|                                                                              |
|     CUSTOMER (CUSTOMER)                                                      |
|                  CUSTOMER#             CUSTOMER#         J2   INTEGER        |
|                  LAST-NAME             LAST_NAME         X16  CHAR(16)       |
|                  FIRST-NAME            FIRST_NAME        X10  CHAR(10)       |
|                  INITIAL               INITIAL           U2   CHAR(2)        |
|                  STREET                STREET            X26  CHAR(26)       |
|                  CITY                  CITY              X12  CHAR(12)       |
|                  STATE                 STATE             X2   CHAR(2)        |
|                  ZIP                   ZIP               X6   CHAR(6)        |
|                  CREDIT-RATING         CREDIT_RATING     R2   CHAR(4)     IU |
|                                                                              |
|     NOTES:                                                                   |
|       I: Imprecise(float)/Incompatible(others) mapping between source and    |
|          mapped data types                                                   |
|       U: Source field has been updated                                       |
|     >>                                                                       |
|                                                                              |
________________________________________________________________________________

In the above example, the NOTES column indicates that the data type
mapping for CREDIT_RATING, the only mapped column whose source data type
is R2, has been updated.  The I indicates that the updated data type
mapping is incompatible with the original data type.



MPE/iX 5.0 Documentation