Support for discrete contingencies on sql.