Information Catalog Manager Programming Guide and Reference

FLGDeleteTypeExt

Deletes a user-defined object type and instances of that object type, any Comments objects attached to those instances, and any relationships in which those instances participate. Also deletes the object type registration.

You can delete an object type of any category except the Program and Attachment categories, because the Information Catalog Manager provides these categories when it creates the information catalog.

Authorization

Administrator

Syntax



APIRET  APIENTRY   FLGDeleteTypeExt( PSZ              pszObjTypeID,
                                     PFLGEXTCODE      pExtCode );

Parameters

pszObjTypeID (PSZ) -- input
Points to the 6-character system-generated unique identifier (object type ID) for the object type to delete.

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.

Usage

Prerequisites:

The object type ID specified as the input parameter must exist.

Restrictions:

FLGDeleteTypeExt does not delete Grouping category object instances that contain instances of objects of a different object type. If such Grouping category instances exist, you must delete them using FLGDeleteTree before you can delete the object type.

You cannot delete the Programs object type that was automatically created in your information catalog. However, an object type can be deleted if it is related to one or more Program instances. The Program instances are automatically updated to clear the values for the HANDLES and PARMLIST properties.

You cannot delete the Comments object type that was automatically created in your information catalog.

Controlling updates to your information catalog

Because FLGDeleteTypeExt deletes all instances of an object type along with the object type, before calling FLGDeleteTypeExt you might want to search for objects of a particular type to ensure that you do not want to retain any of the existing objects of the object type you want to delete.

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

Examples

Figure 64 shows the C language code required to issue the FLGDeleteTypeExt call. This sample code deletes from the information catalog the MYIMAGE object type, all instances of the MYIMAGE object type, all comments attached to instances of the MYIMAGE object type, all relationships in which the MYIMAGE instances participate, and the registration for the MYIMAGE object type.

Figure 64. Sample C language call to FLGDeleteTypeExt

 
 
 APIRET       rc;           // Declare reason code
 UCHAR        pszTypeID[FLG_OBJTYPID_LEN+1];
 FLGEXTCODE   xc = 0;       // Declare extended code
 
   .
   .  /* processing */
   .
 
 rc = FLGDeleteTypeExt (pszTypeID,
                        &xc);
 

Special error handling

If FLGDeleteTypeExt 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, FLGDeleteTypeExt 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, FLGDeleteTypeExt 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 FLGDeleteTypeExt error, include FLGCommit calls in your program just before this call.


[ Top of Page | Previous Page | Next Page ]