Running the ANA_Populate_Enums procedure
Run the ANA_Populate_Enums procedure to update the enumerated values in the ANA_ALL_ENUM_VALUES table. This database procedure reads the enumerated field values from the BMC Remedy AR System ARSCHEMA table and populates the ANA_ALL_ENUM_VALUES table.
If your application uses an overlay form, use the following command at the SQL prompt to run the program:
- (Oracle) SQL>EXECUTE ARADMIN.PKG_ANA_POPULATE_ENUMS.ANA_POPULATE_ENUMS
- (Microsoft SQL Server) SQL>EXECUTE ARSystem.dbo.ANA_POPULATE_ENUMS
If your application does not use an overlay form, use the following commands:
- (Oracle) SQL.EXECUTE ANA_ALL_ENUM_VALUES_DML_7.5_ORA.SQL
- (Microsoft SQL Server) SQL>EXECUTE ANA_ALL_ENUM_VALUES_DML_7.5_MSSQL.SQL
Following is the pseudo code for the ANA_Populated_Enums procedure:
Procedure ANA_Populate_Enums()
Begin
Read the data from the arschema table
For each table row {
While for each <ARForm> Query arschema table and get SchemId and overlayProp
baseSchemaId;
overLaySchemaId;
If (overlayProp=0 OR overlayProp=4) // It is consider as Base Form
{ baseSchemaId= SchemId; }
Else { Query Field_Enum_Values table to get all the enum ids for a given form (base overlayschemaId)
overlaySchemaId= SchemId; }
For each <SchemaId> (base and overlay) get all the enumerated FieldIds from enum_value_fields & Field
Join condition: field.fieldId = field_enum.fieldId and field.schemaId = field_enum.schemaId
fieldId=FieldId
fOverlayProp=overlayProp
} // End of For each <SchemaId>
For each < fieldId>
{
if (fOverlayProp!=0) then SchemaId= overlaySchemaId else SchemaId= baseSchemaId
While for each < SchemaId > get the VUI ID from vui table
Query field_dispprop table for combination of <vuid> <SchemaId><fieldId>
If (propShort is NULL) then strValue=propLong ELSE strValue=propShort
parse the strValue and transpose the data (row to column coversion)
pars logic: (refer sample string parsing example )
subStr= start Index (string after the 230\4) to end Index= value after 230\4 // This is the standard notation for every enumerated values
Tokenzie the subStr with "\" delimiter to get the enum number and its value // Refer the sample string value section
Insert the data into ANA_ALL_ENUM_VALUES // Insert all the required data as per the table design (refer table design section)
Query the RPT_Locale table and ger the locale value and update the ANA_ALL_ENUM_VALUES table with :
update ANA_ALL_ENUM_VALUES set RPT_LOCALEFLAG=1 where ANA_ALL_ENUM_VALUES.localevalue=RPT_Locale.locale
}// End of While for each < tSchemaId>
} //End of For each < fieldId>
} // End of For each < fieldId>
} // End of While for each <ARForm>
End // End of Procedure
Begin
Read the data from the arschema table
For each table row {
While for each <ARForm> Query arschema table and get SchemId and overlayProp
baseSchemaId;
overLaySchemaId;
If (overlayProp=0 OR overlayProp=4) // It is consider as Base Form
{ baseSchemaId= SchemId; }
Else { Query Field_Enum_Values table to get all the enum ids for a given form (base overlayschemaId)
overlaySchemaId= SchemId; }
For each <SchemaId> (base and overlay) get all the enumerated FieldIds from enum_value_fields & Field
Join condition: field.fieldId = field_enum.fieldId and field.schemaId = field_enum.schemaId
fieldId=FieldId
fOverlayProp=overlayProp
} // End of For each <SchemaId>
For each < fieldId>
{
if (fOverlayProp!=0) then SchemaId= overlaySchemaId else SchemaId= baseSchemaId
While for each < SchemaId > get the VUI ID from vui table
Query field_dispprop table for combination of <vuid> <SchemaId><fieldId>
If (propShort is NULL) then strValue=propLong ELSE strValue=propShort
parse the strValue and transpose the data (row to column coversion)
pars logic: (refer sample string parsing example )
subStr= start Index (string after the 230\4) to end Index= value after 230\4 // This is the standard notation for every enumerated values
Tokenzie the subStr with "\" delimiter to get the enum number and its value // Refer the sample string value section
Insert the data into ANA_ALL_ENUM_VALUES // Insert all the required data as per the table design (refer table design section)
Query the RPT_Locale table and ger the locale value and update the ANA_ALL_ENUM_VALUES table with :
update ANA_ALL_ENUM_VALUES set RPT_LOCALEFLAG=1 where ANA_ALL_ENUM_VALUES.localevalue=RPT_Locale.locale
}// End of While for each < tSchemaId>
} //End of For each < fieldId>
} // End of For each < fieldId>
} // End of While for each <ARForm>
End // End of Procedure
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*