Class: OCI8::Metadata::ArgBase

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

Overview

Abstract super class of Argument, TypeArgument and TypeResult.

Direct Known Subclasses

Argument, TypeArgument, TypeResult

Instance Method Summary collapse

Methods inherited from Base

#obj_id, #obj_link, #obj_name, #obj_schema

Instance Method Details

#argumentsObject

The list of arguments at the next level (when the argument is of a record or table type).

This method returns an array containing type information when the type is a user-defined type and the Oracle server version is 12c or earlier. Otherwise, it returns an empty array.



1618
1619
1620
# File 'lib/oci8/metadata.rb', line 1618

def arguments
  @arguments ||= list_arguments.to_a
end

#charset_formObject

Returns the character set form if the argument is of a string/character type



1602
1603
1604
# File 'lib/oci8/metadata.rb', line 1602

def charset_form
  __charset_form
end

#charset_idObject

Returns the character set ID if the argument is of a string/character type



1596
1597
1598
# File 'lib/oci8/metadata.rb', line 1596

def charset_id
  attr_get_ub2(OCI_ATTR_CHARSET_ID)
end

#charset_nameObject

Returns the character set name if the argument is of a string/character type



1608
1609
1610
# File 'lib/oci8/metadata.rb', line 1608

def charset_name
  __charset_name(charset_id)
end

#data_sizeObject

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



1486
1487
1488
# File 'lib/oci8/metadata.rb', line 1486

def data_size
  attr_get_ub2(OCI_ATTR_DATA_SIZE)
end

#data_typeObject

the datatype of the argument



1479
1480
1481
# File 'lib/oci8/metadata.rb', line 1479

def data_type
  __data_type
end

#has_default1 or 0

Deprecated.

Indicates whether an argument has a default

Returns:

  • (1 or 0)


1519
1520
1521
# File 'lib/oci8/metadata.rb', line 1519

def has_default
  attr_get_ub1(OCI_ATTR_HAS_DEFAULT)
end

#has_default?true or false

Indicates whether an argument has a default

Returns:

  • (true or false)

Since:

  • 2.1.6



1527
1528
1529
# File 'lib/oci8/metadata.rb', line 1527

def has_default?
  __boolean(OCI_ATTR_HAS_DEFAULT)
end

#inspectObject

:nodoc:



1622
1623
1624
# File 'lib/oci8/metadata.rb', line 1622

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

#iomodeObject

Indicates the argument mode. Values are :in, :out or :inout



1540
1541
1542
1543
1544
1545
1546
# File 'lib/oci8/metadata.rb', line 1540

def iomode
  case attr_get_ub4(OCI_ATTR_IOMODE)
  when 0; :in
  when 1; :out
  when 2; :inout
  end
end

#levelObject

The nest level.

Oracle manual says that it always returns zero. However it returns the depth of ArgBase#arguments calls when #arguments returns a non-empty array.



1511
1512
1513
# File 'lib/oci8/metadata.rb', line 1511

def level
  attr_get_ub2(OCI_ATTR_LEVEL)
end

For :named_type or :ref, returns a string with the database link name of the database on which the type exists. This can happen only in the case of package local types, when the package is remote.



1585
1586
1587
# File 'lib/oci8/metadata.rb', line 1585

def link
  attr_get_string(OCI_ATTR_LINK)
end

#nameObject

the argument name



1464
1465
1466
# File 'lib/oci8/metadata.rb', line 1464

def name
  attr_get_string(OCI_ATTR_NAME)
end

#positionObject

the position of the argument in the argument list.



1469
1470
1471
# File 'lib/oci8/metadata.rb', line 1469

def position
  attr_get_ub2(OCI_ATTR_POSITION)
end

#precisionObject

The precision of numeric arguments. 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.



1494
1495
1496
# File 'lib/oci8/metadata.rb', line 1494

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

#radixObject

Returns a radix (if number type)



1549
1550
1551
# File 'lib/oci8/metadata.rb', line 1549

def radix
  attr_get_ub1(OCI_ATTR_RADIX)
end

#scaleObject

The scale of numeric arguments. 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.



1502
1503
1504
# File 'lib/oci8/metadata.rb', line 1502

def scale
  attr_get_sb1(OCI_ATTR_SCALE)
end

#schema_nameObject

For :named_type or :ref, returns a string with the schema name under which the type was created, or under which the package was created in the case of package local types



1571
1572
1573
# File 'lib/oci8/metadata.rb', line 1571

def schema_name
  attr_get_string(OCI_ATTR_SCHEMA_NAME)
end

#sub_nameObject

For :named_type or :ref, returns a string with the type name, in the case of package local types



1577
1578
1579
# File 'lib/oci8/metadata.rb', line 1577

def sub_name
  attr_get_string(OCI_ATTR_SUB_NAME)
end

#type_metadataObject

to type metadata if possible



1590
1591
1592
# File 'lib/oci8/metadata.rb', line 1590

def 
  (OCI8::Metadata::Type)
end

#type_nameObject

Returns a string which is the type name, or the package name in the case of package local types. 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.



1564
1565
1566
# File 'lib/oci8/metadata.rb', line 1564

def type_name
  attr_get_string(OCI_ATTR_TYPE_NAME)
end

#typecodeObject

typecode



1474
1475
1476
# File 'lib/oci8/metadata.rb', line 1474

def typecode
  __typecode(OCI_ATTR_TYPECODE)
end