Information Catalog Manager Programming Guide and Reference

FLGUpdateInst

Alters one or more property values for a specific object instance.

Authorization

Administrator or authorized user (all object types); user (Comments object type only)

Syntax



APIRET  APIENTRY    FLGUpdateInst( PFLGHEADERAREA   pObjInstStruct,
                                   PFLGEXTCODE      pExtCode );

Parameters

pObjInstStruct (PFLGHEADERAREA) -- input
Points to the input structure that contains the property specifications and values of the database object being updated.

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 FLGUpdateInst, you must define the input structure shown in Figure 154. This structure contains the header area, the definition area, and the object area.

Figure 154. FLGUpdateInst input structure


Figure FLAA2062 not displayed.

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

Usage

Prerequisites

Before issuing an FLGUpdateInst call, you must issue either an FLGCreateInst call or an FLGGetInst call to obtain the property specifications and values of the instance being modified.

Input requirements

Header area:

  • All of the information shown in the header record is required.
  • The value for the object type identifier must be the same in the header record (bytes 33 through 38) as in the object area (first item in the object area).

Definition area:

The definition area can contain any or all of the defined properties of the object type for which you are updating an object instance. The following rules apply:

  • You must first specify all five of the Information Catalog Manager required properties in the following order: OBJTYPID, INSTIDNT, NAME, UPDATIME, and UPDATEBY.
  • You must specify all UUI properties.
  • The Information Catalog Manager compares the values for all specified properties to the object type definition for the following specifications:

    Data type

    Data length

    Property short name

    Value flag

    UUI number

Object area:

  • The object type in the HANDLES property (when specified) must exist in the information catalog and be a non-Program object type. Any properties specified in the PARMLIST property must be a property of the object type specified in HANDLES. For more information, see Setting up Programs objects to start programs.
  • If a value is not specified for a required property (defined with an R in column 126 of the definition area) the appropriate space in the object area must be initialized as follows:
    Data type Initialized to
    CHAR Not-applicable symbol followed by blanks for the length of the property
    TIMESTAMP Set to the largest allowable value: 9999-12-31-24.00.00.000000
    VARCHAR LONG VARCHAR 00000001; the length field, specified in 8 bytes, followed by the not-applicable symbol
  • Values for the OBJTYPID and INSTIDNT properties identify the instance being updated, and therefore must be present.
  • Values for the UPDATIME and UPDATEBY properties are system generated and therefore should not be modified by the user. If you issue an FLGGetInst call before issuing this FLGUpdateInst call, the object area can contain values for these two system-generated properties. This does not cause an error, but when the instance is updated, the system replaces the values of these two properties.

Trailing blanks are automatically removed from object area values that have VARCHAR or LONG VARCHAR data types and the length field is adjusted accordingly.

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 FLGUpdateInst completes successfully. If FLGUpdateInst does not complete successfully, you should include a call to FLGRollback (see FLGRollback).

Examples

Figure 155 shows the C language code required to invoke the FLGUpdateInst API call.

This sample code updates the object instance named Quality Group that was defined in the FLGCreateInst example. The update modifies the value for the short description property, Sdesc.

Figure 155. Sample C language call to FLGUpdateInst

 
 APIRET         rc;                    // Declare reason code
 PFLGHEADERAREA  pObjInstStruct;       // Pointer to the input structure
 FLGEXTCODE     ExtCode = 0;                // Declare extended code
   .
   .  /* updating pObjInstStruct object Instance by   */
      /*                           providing an updated input structure */
   .
 
 rc = FLGUpdateInst (pObjInstStruct,   // Pointer to updated input structure
                     &ExtCode);             // Pass pointer to extended code
 

Figure 156 shows the input structure (pointed to by the "pObjInstStruct" pointer in the C code) that carries the property and value information for the object instance to be updated.

Figure 156. Sample input structure for FLGUpdateInst


Figure FLAA2063 not displayed.

The values in the object area that are not system-generated (the value at byte 126 is not S) can be modified:

When you use FLGUpdateInst, you can omit properties and values that you are not modifying.

In this example, the Sdesc value is updated. Modifying the Sdesc value affects its length also. Therefore, the 8-character length field that precedes the Sdesc field in the object area is modified from 27 to 40. The object Length value in the header record is changed from 246 to 259.

When FLGUpdateInst completes, the value for UPDATEBY is modified to contain the user ID used to update the instance, and UPDATIME is modified to contain the time stamp of the update.


[ Top of Page | Previous Page | Next Page ]