Creates a new instance of the specified object type.
Authorization
Administrator or authorized user (all object types); user (Comments object type only)
Syntax
APIRET APIENTRY FLGCreateInst( PFLGHEADERAREA pObjInstStruct,
PSZ pszFLGID,
PFLGEXTCODE pExtCode );
Parameters
Characters 1-6 of this ID identify the object type of this instance; these characters have the same value as bytes 33 through 38 in the input structure header record.
Characters 7-16 of this ID are the system-generated unique instance identifier.
This returned pszFLGID is used by other API calls when referring to this instance.
pszFLGID is set to NULL if the FLGCreateInst API call is not successful.
See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.
Input structure
To use FLGCreateInst, you must define the input structure shown in Figure 47. This structure contains the header area, the definition area, and the object area.
Figure 47. FLGCreateInst input structure
For an explanation of the meanings of the byte offsets, see The Information Catalog Manager API input structure.
Usage
Prerequisites
Restriction
If you are not authorized to perform object management tasks and you are creating a Comments object instance, you must not change the Creator property value to be other than your logged-on user ID.
Input requirements
Header area:
All of the fields in the header record are required.
Definition area:
The definition area can contain any or all of the defined properties of the object type for which you are creating an object instance. The following rules apply:
Data type
Data length
Property short name
Value flag
UUI number
Object area:
The value of the property NAME does not have to be unique within an object type; you can successfully create duplicate entries. However, when you create duplicate entries, specify some descriptive information as the value of another property to differentiate one object instance from another.
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 |
Data type | Initialized to |
---|---|
CHAR TIMESTAMP | Blanks for the entire length of the property |
VARCHAR LONG VARCHAR | 00000000; the length field, specified in 8 bytes, must be present and set to zero |
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 FLGCreateInst completes successfully. If FLGCreateInst does not complete successfully, you should include a call to FLGRollback (see FLGRollback).
Figure 48 shows the C language code required to call FLGCreateInst.
This sample code creates a new instance of a Grouping object type.
Figure 48. Sample C language call to FLGCreateInst
APIRET rc; // Declare reason code
PFLGfEADERAREA pObjInstStruct; // Pointer to the input structure
UCHAR pszFLGID[FLG_ID_LEN+1]; // Returns system-generated ID
FLGEXTCODE ExtCode = 0; // Declare extended code
.
/* creating pObjInstStruct object Instance by providing property values */
.
.
rc = FLGCreateInst (pObjInstStruct, // input structure
pszFLGID, // Returned ID of created instance
&ExtCode); // Pass pointer to extended code
Figure 49 shows the input structure for the FLGCreateInst call. The pObjInstStruct parameter points to this structure, which carries the property and value information for the new object instance.
Figure 49. Sample input structure for FLGCreateInst
Notes: