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

Constant Summary

Constant Summary

Constants inherited from Base

Base::DATA_TYPE_MAP

Instance Method Summary (collapse)

Methods inherited from Base

#obj_id, #obj_name, #obj_schema

Instance Method Details

- (Object) charset_form

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



954
955
956
# File 'lib/oci8/metadata.rb', line 954

def charset_form
  __charset_form
end

- (Object) charset_id

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



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

def charset_id
  attr_get_ub2(OCI_ATTR_CHARSET_ID)
end

- (Object) charset_name

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



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

def charset_name
  __con.charset_id2name(charset_id)
end

- (Object) data_size

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.



893
894
895
# File 'lib/oci8/metadata.rb', line 893

def data_size
  attr_get_ub2(OCI_ATTR_DATA_SIZE)
end

- (Object) data_type

the datatype of the type



903
904
905
# File 'lib/oci8/metadata.rb', line 903

def data_type
  __data_type
end

- (Object) fsprecision

The fractional seconds precision of a datetime or interval.

(unavailable on Oracle 8.1 or lower)



962
963
964
# File 'lib/oci8/metadata.rb', line 962

def fsprecision
  attr_get_ub1(OCI_ATTR_FSPRECISION)
end

- (Object) inspect

:nodoc:



979
980
981
# File 'lib/oci8/metadata.rb', line 979

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

- (Object) lfprecision

The leading field precision of an interval

(unavailable on Oracle 8.1 or lower)



969
970
971
# File 'lib/oci8/metadata.rb', line 969

def lfprecision
  attr_get_ub1(OCI_ATTR_LFPRECISION)
end

- (Object) name

the type attribute name



908
909
910
# File 'lib/oci8/metadata.rb', line 908

def name
  attr_get_string(OCI_ATTR_NAME)
end

- (Object) precision

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.



916
917
918
# File 'lib/oci8/metadata.rb', line 916

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

- (Object) scale

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.



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

def scale
  attr_get_sb1(OCI_ATTR_SCALE)
end

- (Object) schema_name

schema name where the type has been created.



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

def schema_name
  attr_get_string(OCI_ATTR_SCHEMA_NAME)
end

- (Object) type_metadata

to type metadata if possible



944
945
946
# File 'lib/oci8/metadata.rb', line 944

def 
  (OCI8::Metadata::Type)
end

- (Object) type_name

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.



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

def type_name
  attr_get_string(OCI_ATTR_TYPE_NAME)
end

- (Object) typecode

typecode



898
899
900
# File 'lib/oci8/metadata.rb', line 898

def typecode
  __typecode(OCI_ATTR_TYPECODE)
end