Class: OCI8::Metadata::TypeAttr

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

Overview

Metadata for a type attribute.

This is returned by:

  • OCI8::Metadata::Type#type_attrs

Instance Method Summary collapse

Methods inherited from Base

#obj_id, #obj_name, #obj_schema

Instance Method Details

#charset_formObject

character set form, if the type attribute is of a string/character type.



986
987
988
# File 'lib/oci8/metadata.rb', line 986

def charset_form
  __charset_form
end

#charset_idObject

character set id if the type attribute is of a string/character type.



981
982
983
# File 'lib/oci8/metadata.rb', line 981

def charset_id
  attr_get_ub2(OCI_ATTR_CHARSET_ID)
end

#charset_nameObject

character set name if the type attribute is of a string/character type.



1007
1008
1009
# File 'lib/oci8/metadata.rb', line 1007

def charset_name
  __con.charset_id2name(charset_id)
end

#data_sizeObject

The maximum size of the type attribute. This length is returned in bytes and not characters for strings and raws. It returns 22 for NUMBERs.



925
926
927
# File 'lib/oci8/metadata.rb', line 925

def data_size
  attr_get_ub2(OCI_ATTR_DATA_SIZE)
end

#data_typeObject

the datatype of the type



935
936
937
# File 'lib/oci8/metadata.rb', line 935

def data_type
  __data_type
end

#fsprecisionObject

The fractional seconds precision of a datetime or interval.

(unavailable on Oracle 8.1 or lower)



994
995
996
# File 'lib/oci8/metadata.rb', line 994

def fsprecision
  attr_get_ub1(OCI_ATTR_FSPRECISION)
end

#inspectObject

:nodoc:



1011
1012
1013
# File 'lib/oci8/metadata.rb', line 1011

def inspect # :nodoc:
  "#<#{self.class.name}: #{name} #{__data_type_string}>"
end

#lfprecisionObject

The leading field precision of an interval

(unavailable on Oracle 8.1 or lower)



1001
1002
1003
# File 'lib/oci8/metadata.rb', line 1001

def lfprecision
  attr_get_ub1(OCI_ATTR_LFPRECISION)
end

#nameObject

the type attribute name



940
941
942
# File 'lib/oci8/metadata.rb', line 940

def name
  attr_get_string(OCI_ATTR_NAME)
end

#precisionObject

The precision of numeric type attributes. If the precision is nonzero and scale is -127, then it is a FLOAT, else it is a NUMBER(precision, scale). For the case when precision is 0, NUMBER(precision, scale) can be represented simply as NUMBER.



948
949
950
# File 'lib/oci8/metadata.rb', line 948

def precision
  __is_implicit? ? attr_get_sb2(OCI_ATTR_PRECISION) : attr_get_ub1(OCI_ATTR_PRECISION)
end

#scaleObject

The scale of numeric type attributes. If the precision is nonzero and scale is -127, then it is a FLOAT, else it is a NUMBER(precision, scale). For the case when precision is 0, NUMBER(precision, scale) can be represented simply as NUMBER.



956
957
958
# File 'lib/oci8/metadata.rb', line 956

def scale
  attr_get_sb1(OCI_ATTR_SCALE)
end

#schema_nameObject

schema name where the type has been created.



971
972
973
# File 'lib/oci8/metadata.rb', line 971

def schema_name
  attr_get_string(OCI_ATTR_SCHEMA_NAME)
end

#type_metadataObject

to type metadata if possible



976
977
978
# File 'lib/oci8/metadata.rb', line 976

def 
  (OCI8::Metadata::Type)
end

#type_nameObject

A string which is the type name. The returned value will contain the type name if the datatype is :named_type or :ref. If the datatype is :named_type, the name of the named datatype’s type is returned. If the datatype is :ref, the type name of the named datatype pointed to by the REF is returned.



966
967
968
# File 'lib/oci8/metadata.rb', line 966

def type_name
  attr_get_string(OCI_ATTR_TYPE_NAME)
end

#typecodeObject

typecode



930
931
932
# File 'lib/oci8/metadata.rb', line 930

def typecode
  __typecode(OCI_ATTR_TYPECODE)
end