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
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
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:
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).
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
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.