Information Catalog Manager Programming Guide and Reference

FLGAppendType

Appends optional properties to an existing object type.

You can append to any object type except the Comments object type, because the Comments object type cannot be extended.

Authorization

Administrator

Syntax



APIRET  APIENTRY    FLGAppendType( PFLGHEADERAREA   pObjTypeStruct,
                                   PFLGEXTCODE      pExtCode );

Parameters

pObjTypeStruct (PFLGHEADERAREA) -- input
Points to the input structure that contains the specifications for one or more properties to be appended for this object type.

pExtCode (PFLGEXTCODE) -- output
Points to an extended code associated with the reason code. See Appendix D, Information Catalog Manager reason codes to see if a meaningful extended code is associated with the returned reason code.

Reason code (APIRET)
Represents the execution result of this API call.

See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.

Input structure

To use FLGAppendType, you must define the input structure shown in Figure 42. This structure contains only the header area and the definition area.

Figure 42. FLGAppendType input structure


Figure FLAA2001 not displayed.

For an explanation of the meanings of the byte offsets, see The Information Catalog Manager API input structure.

Usage

Restrictions:

You can append to any object type except the Comments object type, because the Comments object type cannot be extended.

If you append a new property that already exists within the object type, the "new" property is treated as a duplicate and FLGAppendType completes successfully with a warning (FLG_WRN_PROPDUP). A property is a duplicate if all of the following match an existing property:

Data type

Data length

Property short name

Value flag

UUI number

Input requirements:

Header area
  • The object type ID in bytes 33-38 must exist in the catalog.
  • The category specified in byte 32 must match the category of the existing object type specified in bytes 33-38.
Definition area
  • The input structure should not contain any previously defined properties for this object type, only new properties that are to be appended.
  • Any properties being appended must be optional. Specify the letter O in the value flag field in byte 126.
  • Any properties being appended cannot be defined as part of the universal unique identifier (UUI); define the field in byte 127 as blank.
  • New property names must be unique within the object type.
  • New property short names must be unique within the object type. Property short names must follow these rules:
    • Characters must be single-byte character set (SBCS) only.
    • The first character must be an English alphabetic character (A through Z or a through z), @, #, or $.
    • Characters other than the first can be an English alphabetic character (A through Z or a through z), 0 through 9, @, #, $, or _ (underscore).
    • No leading or embedded blanks are allowed.
    • The name cannot be any of the SQL reserved words for the current database. See the documentation for the underlying database for a list of reserved words.
  • The total length of all of the properties for an object type must not exceed the environment limit. The limit depends on the maximum limit for a row (including overhead) for your database system. For more information, see the DB2 UDB SQL reference for your database system.
In general:
  • The maximum number of properties for an object type is 255 (FLG_MAX_PROPERTIES).
  • The maximum number of properties for an object type that can have a data type of LONG VARCHAR is 14 (FLG_MAX_NUM_LONG_VARCHARS).
Controlling updates to your information catalog

To keep your program as synchronized as possible with your information catalog, you should include a call to FLGCommit (see FLGCommit) after FLGAppendType completes successfully. If FLGAppendType does not complete successfully, you should include a call to FLGRollback (see FLGRollback).

Examples

Figure 43 shows the C language code required to issue the FLGAppendType call. This code appends an additional property named Density to the object type with an object type identifier of 000044.

Figure 43. Sample C language call to FLGAppendType

 
 APIRET           rc;              // Declare reason code
 PFLGHEADERAREA   pObjTypeStruct;  // Pointer to the input structure 
 FLGEXTCODE       ExtCode = 0;          // Declare extended code
 
   .
   .  /* Appending pObjTypeStruct object Type */
   .          /*  by providing object properties     */
   .
 
 rc = FLGAppendType (pObjTypeStruct,
                      &ExtCode);        // Pass pointer to extended code
 

Figure 44 shows the input structure for the FLGAppendType call. The pObjTypeStruct parameter points to this input structure.

Figure 44. Sample input structure for FLGAppendType


Figure FLAA2002 not displayed.

Special error handling

If FLGAppendType encounters a database error, the Information Catalog Manager rolls back the database to the last commit that occurred in your program.

If this rollback is successful, FLGAppendType returns the reason code FLG_SEVERR_DB_AUTO_ROLLBACK_COMPLETE. The extended code contains the SQL code for the database error that prompted the Information Catalog Manager to roll back the database.

Attention: If this rollback fails, FLGAppendType returns the reason code FLG_SEVERR_DB_AUTO_ROLLBACK_FAIL. The extended code contains the SQL code for the database error that prompted the Information Catalog Manager to roll back the database. In this case, your database could have severe integrity problems, and your program should call FLGTerm to exit the Information Catalog Manager.

Depending on the state of your database, you might need to recover your database using your backed-up database files. For more information about recovering your information catalog database, see the Information Catalog Manager Administration Guide.

To prevent the Information Catalog Manager from removing uncommitted changes that are not related to the FLGAppendType error, include FLGCommit calls in your program just before this call.


[ Top of Page | Previous Page | Next Page ]