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
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
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:
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:
Data type
Data length
Property short name
Value flag
UUI number
Object area:
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 |
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).
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
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.