Verifies the syntax of the specified rules file.
Syntax
ESS_FUNC_M EssVerifyRulesFile (hCtx, ruleFileName, pNmColumns, ppColumnErrors);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
ruleFileName | ESS_STR_T | The name of the rules file to verify. |
pNmColumns | ESS_PULONG_T | Pointer to the number of columns in the rules file. |
ppColumnErrors | ESS_ULONG_T | Pointer to the array of errors found. |
Notes
This function requires that a specific database be active; that is, EssSetActive() is required.
This function is intended to be used after the rules file has been put on the server.
There is one value in the array ppColumnErrors for each column in the rules file. The nth value in the array corresponds to errors found for the nth column in the rules file. Each error value may be zero or more of the following error codes combined with logical OR.
Error code | Meaning |
---|---|
DAT_VERIFY_INVALIDMBR | There is an unknown member (or no member) in the field name. |
DAT_VERIFY_INVALIDHDR | There is an unknown member in the header. (This error code applies to the header, and will |
DAT_VERIFY_SAMENAME | This field has the same field name as another field. |
DAT_VERIFY_DIMUSED | The dimension name is used in another field name or in the header. |
DAT_VERIFY_MBRUSED | A member name used as part of a combination in this field is used as a single member name in |
DAT_VERIFY_DIMINCROSSDIM | A dimension name is used in a cross-dimensional reference in the field name. |
DAT_VERIFY_DATAFIELD | Only one field can have the Data Field attribute. |
DAT_VERIFY_SIGNFLIPDIM | The dimension used for Sign Flip checking is not in the associated outline. |
DAT_VERIFY_DUPINHEADER | This field name is also defined in the header definition. |
DAT_VERIFY_DATEANDDATA | A field may be designated a Data Field or Date Field, but not both. |
DAT_VERIFY_DATEFIELDNAME | The field name of a date field must be the name of a date dimension. |
DAT_VERIFY_DATEFORMAT | There is an unrecognized date format for this date column. |
Return Value
If successful, returns the number of columns in the rules file as pNmColumns and the array of errors found in ppColumnErrors.
Access
This function requires no special privileges.
Example
{ ESS_STS_T sts = ESS_STS_NOERR; ESS_ULONG_T numColumns = 0, i; ESS_PULONG_T pColumnErrors = NULL; sts = EssVerifyRulesFile(hCtx, "rule_file", &numColumns, &pColumnErrors); if(!sts) { if(numColumns && pColumnErrors) { printf("NumColumns: %d\n", numColumns); for(i=0; i<numColumns; i++) { printf("Column[%d]:\n", i+1); if( pColumnErrors[i] == 0 ) printf(" No error\n"); else { if( pColumnErrors[i] & DAT_VERIFY_INVALIDMBR ) printf(" There is an unknown member (or no member) in the field name.\n"); if( pColumnErrors[i] & DAT_VERIFY_INVALIDHDR ) printf(" There is an unknown member in the header.\n"); if( pColumnErrors[i] & DAT_VERIFY_SAMENAME ) printf(" This field has the same field name as another field.\n"); if( pColumnErrors[i] & DAT_VERIFY_DIMUSED ) printf(" The dimension name is used in another field name or in the header.\n"); if( pColumnErrors[i] & DAT_VERIFY_MBRUSED ) printf(" A member name used as part of a combination in this field is used as a single member name in another field.\n"); if( pColumnErrors[i] & DAT_VERIFY_DIMINCROSSDIM ) printf(" A dimension name is used in a cross-dimensional reference in the field name.\n"); if( pColumnErrors[i] & DAT_VERIFY_DATAFIELD ) printf(" Only one field can have the Data Field attribute.\n"); if( pColumnErrors[i] & DAT_VERIFY_SIGNFLIPDIM ) printf(" The dimension used for Sign Flip checking is not in the associated outline.\n"); if( pColumnErrors[i] & DAT_VERIFY_DUPINHEADER ) printf(" This field name is also defined in the header definition.\n"); if( pColumnErrors[i] & DAT_VERIFY_DATEANDDATA ) printf(" A field may be designated a Data Field or a Date Field, but not both.\n"); if( pColumnErrors[i] & DAT_VERIFY_DATEFIELDNAME ) printf(" The field name of a date field must be the name of a date dimension.\n"); if( pColumnErrors[i] & DAT_VERIFY_DATEFORMAT ) printf(" There is an unrecognized date format for this date column.\n"); } } EssFree(hInst, pColumnErrors); } } }
See Also