Information Catalog Manager Programming Guide and Reference

FLGDeleteType

Deletes a user-defined object type.

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   FLGDeleteType( 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 be deleted.

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.

No object instances can exist for the object type. If instances of an object type exist, you must delete them using FLGDeleteInst before you can delete the object type. You can either delete the instances individually using FLGDeleteInst or delete several instances at once by importing a tag language file.

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

If FLGDeleteType does not complete successfully, you should include a call to FLGRollback (see FLGRollback). Do not call FLGCommit after FLGDeleteType completes successfully--wait until you complete a call to FLGDeleteReg.

Examples

Figure 63 shows the C language code required to invoke the FLGDeleteType API call. This sample code deletes an object type from the information catalog.

Figure 63. Sample C language call to FLGDeleteType

 
 APIRET       rc;           // Declare reason code
 UCHAR        pszObjTypeID[FLG_OBJTYPID_LEN + 1];
 FLGEXTCODE   ExtCode = 0;       // Declare extended code
 
   .
   .  /* Get the object type ID of MYIMAGE using FLGConvertID. */
   .
 
 rc = FLGDeleteType (pszObjTypeID,
                      &ExtCode);
   .
   . // if (rc == 0)
   . //   rc = FLGDeleteReg (pszObjTypeID, &ExtCode);
   . // if (rc == 0)
   . //   rc = FLGCommit (&ExtCode);
   . // else
   . //   rc = FLGRollback (&ExtCode);
   .
 

If instances of MYIMAGE exist, you must delete them before you can delete the MYIMAGE object type. You can either delete the instances individually using the administrator user interface or delete several instances at once by importing a tag language file.

Special error handling

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


[ Top of Page | Previous Page | Next Page ]