Information Catalog Manager Programming Guide and Reference

FLGSearchAll

Searches all object types in the information catalog to locate any instances that have instance names (value of Name property) that match the search criterion.

Authorization

Administrator or user

Syntax



APIRET  APIENTRY   FLGSearchAll( PFLGHEADERAREA   pSelCriteriaStruct,
                                 PFLGHEADERAREA * ppListStruct,
                                 PFLGEXTCODE      pExtCode );

Parameters

pSelCriteriaStruct (PFLGHEADERAREA) -- input
Points to an input structure.

The structure contains the property specification and value of the search criterion. Only the value of the object instance's external name (Name) can be used as the search criterion with FLGSearchAll.

If pSelCriteriaStruct is set to NULL, then the Information Catalog Manager returns all instances in the information catalog up to a maximum of approximately 5000.

ppListStruct (PFLGHEADERAREA) -- output
Points to the address of the pointer to the output structure containing a list of selected object instances resulting from the search. If there is no output structure, then the pointer to the output structure is set to NULL. Each instance has the following information:

All instances are first sorted by object type name, then by the instance external name (value of Name) in ascending order according to the collating order of the underlying database management system.

The maximum number of object instances that can be returned by FLGSearchAll is approximately 5000, depending on the storage available on your machine.

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 specify search criterion for FLGSearchAll, you must define the following input structure. This structure contains the header area, the definition area, which can contain only the Name property, and the object area.

Figure 147. FLGSearchAll input structure


Figure FLAA2058 not displayed.

The definition area for the FLGSearchAll input structure must be specified exactly as shown in Figure 147. For an explanation of the meanings of the byte offsets, see The Information Catalog Manager API input structure.

Output structure

FLGSearchAll produces an output structure containing a list of objects retrieved using the search criterion, as shown in Figure 148.

The object area of the output structure contains a list of all the object instances that match the input search criteria. The returned object instances are identified by the values of the FLGID and object instance external name.

Figure 148. FLGSearchAll output structure


Figure FLAA2059 not displayed.

Usage

Only the value of the object instance's external name (Name) can be used as the search criterion. No other property values can be used with FLGSearchAll. If you need to use the values of other properties in your search criterion, use FLGSearch (see FLGSearch).

You can include wildcard characters in the search criterion. These characters allow you to specify a pattern you are trying to locate in the values for a given property. The database supports two wildcard characters:

%
Represents zero or more characters
_
Represents one character

Although you can use different wildcard characters in the user interface, you can only use the % and _ characters with FLGSearchAll.

If you include wildcard characters in the search criterion, you must set the fuzzy-search flag (fs) to Y.

You must specify values for the following flags in the definition area:

cs
Case-sensitivity flag in byte 128. Valid values are Y for case sensitive, N for not case sensitive.

If your information catalog is located on DB2 UDB for OS/390 and:

  • Was created with all uppercase values (the default), then the case-sensitivity flag must be N.
  • Was created with mixed-case values, then the case-sensitivity flag must be Y.

fs
Fuzzy search flag in byte 129. Valid values are Y for fuzzy search, N for not a fuzzy search. This value must be Y if you want to search using wildcards (% or _) are included in the search criterion.

Controlling updates to your information catalog

FLGSearchAll commits changes to the database. Your program should issue FLGCommit or FLGRollback before issuing FLGSearchAll to ensure that the Information Catalog Manager does not also commit unexpected changes that occurred before the FLGSearchAll call.

Freeing memory allocated for an output structure

If FLGSearchAll returned data in the output structure, you must save the data returned in the output structure and then call FLGFreeMem (see FLGFreeMem). Do not use other methods, for example, C language instructions, to free memory.

Examples

Figure 149 shows the C language code required to invoke the FLGSearchAll. This sample code searches for a name across all object type instances.

Figure 149. Sample C language call to FLGSearchAll

 
 APIRET           rc;                // reason code from FLGSearchAll
 PFLGHEADERAREA   pSelCriteria;         // search criterion input structure pointer
 PFLGHEADERAREA  * ppListStruct;  // pointer to search result pointer
 FLGEXTCODE       ExtCode = 0;            // Declare extended code
   .
   .  /* provide values for input parameters */
   .
 
 rc = FLGSearchAll ( pSelCriteria,        // input structure pointer
                 ppListStruct, // pass the address of
                                    // output structure pointer
                 &ExtCode);
 

Figure 150 shows the search condition input structure (pointed to by pSelCriteria) that carries the property and value information for the search.

Figure 150. Sample input structure for FLGSearchAll


Figure FLAA2060 not displayed.

In this example, you want to perform a fuzzy search using wildcard characters in the search criterion, so the fuzzy search flag at byte 129 of the definition area is set to Y.

The case-sensitivity flag at byte 128 of the definition area is set to N, because the user does not need case sensitivity in the search criterion. Figure 151 shows the output structure (ppListStruct points to the address of the pointer to this output structure) that carries the Information Catalog Manager objects as the search result.

Figure 151. Sample output structure for FLGSearchAll


Figure FLAA2061 not displayed.

The specified partial object instance name is used by the nine instances in two different object types.


[ Top of Page | Previous Page | Next Page ]