Effects of Deterministic Property on Virtual Computed Columns

SAP ASE guarantees repeatable reads on deterministic virtual computed columns, even though, by definition, a virtual computed column is evaluated each time it is referenced.

For example, this statement always returns the same result, if the data in the table does not change:
select Cust_ID, Property_ID from Renting
     where Formatted_Name ='RICHARD HUANG'
SAP ASE does not guarantee repeatable reads on nondeterministic virtual computed columns. For example, in this query, the column Rent_Due returns different results on different days; the column has a serial time property, for which the value is a function of the amount of time that passes between rent payments:
select Cust_Name, Rent_Due from renting 
    where Cust_Name= 'RICHARD HUANG'

The nondeterministic property is useful here, but use it with caution. For instance, if you inadvertently defined Start_Date as a virtual computed column and entered the same query, you would rent all your properties for nothing: Start_Date is always evaluated to the current date, so in this query, the number of Rental_Days is always 0.

Likewise, if you mistakenly define the nondeterministic computed column Rent_Due as a preevaluated column, either by declaring it materialized or by using it as an index key, you would rent your properties for nothing. It is evaluated only once, when the record is inserted, and the number of rental days is 0. This value is returned each time the column is referenced.