Method: Sequel::SQL::CastMethods#cast_numeric
- Defined in:
- lib/sequel/sql.rb
#cast_numeric(sql_type = nil) ⇒ Object
Cast the reciever to the given SQL type (or the database’s default Integer type if none given), and return the result as a NumericExpression, so you can use the bitwise operators on the result.
Sequel.function(:func).cast_numeric # CAST(func() AS integer)
Sequel.function(:func).cast_numeric(Float) # CAST(func() AS double precision)
688 689 690 |
# File 'lib/sequel/sql.rb', line 688 def cast_numeric(sql_type = nil) Cast.new(self, sql_type || Integer).sql_number end |