Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/oci8/oci8.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#to_onum(format = nil, nls_params = nil) ⇒ OraNumber

Converts self to OraNumber. Optional format and nls_params is used as Oracle SQL function TO_NUMBER does.

Examples:

'123456.789'.to_onum # => #<OraNumber:123456.789>
'123,456.789'.to_onum('999,999,999.999') # => #<OraNumber:123456.789>
'123.456,789'.to_onum('999G999G999D999', "NLS_NUMERIC_CHARACTERS = ',.'") # => #<OraNumber:123456.789>

Parameters:

  • format (String) (defaults to: nil)
  • nls_params (String) (defaults to: nil)

Returns:



753
754
755
# File 'lib/oci8/oci8.rb', line 753

def to_onum(format = nil, nls_params = nil)
  OraNumber.new(self, format, nls_params)
end