Formula Errors
There are two types of error that can occur when using Oracle FastFormula:
- Verify-time errors occur in the Formulas window when you run the formula verification. An error message explains the nature of the error.
Common verify-time errors are syntax errors resulting from typing mistakes.
- Run-time errors occur when a problem arises while a formula is running. The usual cause is a data problem, either in the formula or in the application database.
Below is a list of the basic Oracle FastFormula errors that can occur at run-time.
Uninitialized Variables
An uninitialized local variable is one that has no value when the formula runs. This causes an error in all statements except the Return statement. For example:
IF (tax_band < 2000)
THEN tax = salary / 8
IF (tax_band > 2000)
THEN tax = salary / 10
IF tax > 1000
THEN ...
This formula fails with an 'Uninitialized variable' message (for the variable tax) if the tax band is set to 2000.
Divide by Zero
Dividing a number by zero is an operation that provides no logical result. If this situation ever arises, Oracle FastFormula passes a code indicating an error back to the application (the application then takes the appropriate action).
Always check for the possibility of a divide by zero error if there is any chance it could occur. For example, the formula:
x = salary/contribution_proportion
produces an error if the contribution proportion is set to zero. In this formula, check for the divide by zero condition as follows:
IF contribution_proportion = 0
THEN (message = 'The contribution proportion is not valid.'
RETURN message)
ELSE x = salary/contribution_proportion
No Data Found
A database item supposed to be in the database was not found. This represents an error in the application data.
Too Many Rows
The database item definition within the application caused more than one value to be fetched from the database.
Value Exceeded Allowable Range
This can occur for a variety of reasons such as:
- exceeding the maximum allowable length of a string (which is 240 characters)
- rounding up a number to an excessive number of places, for example, round (1,100)
- using an invalid date, for example, 39-DEC-1990.
Invalid Number
This occurs only when database item contains a bad number.
Null Data Found
A database item was found to have a null value when it should have had a non-null value. Use the Default statement for database items marked as Default Required in the Database Items window.