HP 3000 Manuals

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


HP IMAGE/SQL Administration Guide

UPDATE TYPE 

Updates data type mapping information.

Syntax 

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

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

* (asterisk)      indicates that you want 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 want 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 want to update.  Use either
                  this parameter or the SourceType parameter.

NewMappedType     is the new data type you want to assign.  If this
                  parameter is omitted, default IMAGE/SQL utility data
                  type mapping is used.  (See Table 2-6  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
IMAGE/SQL utility data type mapping values, omit the TO NewMappedType 
parameter.

Update data type mapping before IMAGE/SQL 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
alternative data type mapping.

Table 2-2  in Chapter 2 summarizes IMAGE/SQL data type mapping
defaults and alternatives.

Example 

In the following example, the UPDATE TYPE command is used to specify the
alternative 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