Class: OCI8::Metadata::Table
Overview
Information about tables
An instance of this class is returned by:
Instance Method Summary collapse
-
#clustered? ⇒ Boolean
Returns
true
if the table is part of a cluster. -
#columns ⇒ array of OCI8::Metadata::Column
Returns column information of the table.
-
#dba ⇒ Integer
Returns a Data Block Address(DBA) of the segment header.
-
#duration ⇒ :transaction, :session or nil
Retruns
:transaction
if the table is a transaction-specific temporary table. -
#index_only? ⇒ Boolean
Returns
true
if the table is an index-organized table Otherwise,false
. -
#is_temporary? ⇒ Boolean
Returns
true
if the table is a temporary table. -
#is_typed? ⇒ Boolean
Returns
true
if the table is a object table. -
#num_cols ⇒ Integer
Returns number of columns.
-
#partitioned? ⇒ Boolean
Returns
true
if the table is a partitioned table. -
#tablespace ⇒ Integer
Returns a tablespace number the table resides in.
-
#type_metadata ⇒ OCI8::Metadata::Type or nil
Retruns an instance of OCI8::Metadata::Type if the table is an object table.
Methods inherited from Base
#obj_id, #obj_name, #obj_schema
Instance Method Details
#clustered? ⇒ Boolean
Returns true
if the table is part of a cluster. Otherwise, false
.
433 434 435 |
# File 'lib/oci8/metadata.rb', line 433 def clustered? attr_get_ub1(OCI_ATTR_CLUSTERED) != 0 end |
#columns ⇒ array of OCI8::Metadata::Column
Returns column information of the table.
454 455 456 |
# File 'lib/oci8/metadata.rb', line 454 def columns @columns ||= list_columns.to_a end |
#dba ⇒ Integer
Returns a Data Block Address(DBA) of the segment header.
The dba is converted to the file number and the block number by DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE and DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK respectively.
419 420 421 |
# File 'lib/oci8/metadata.rb', line 419 def dba attr_get_ub4(OCI_ATTR_RDBA) end |
#duration ⇒ :transaction, :session or nil
Retruns :transaction
if the table is a transaction-specific temporary table. :session
if it is a session-specific temporary table. Otherwise, nil
.
406 407 408 |
# File 'lib/oci8/metadata.rb', line 406 def duration __duration end |
#index_only? ⇒ Boolean
Returns true
if the table is an index-organized table Otherwise, false
.
447 448 449 |
# File 'lib/oci8/metadata.rb', line 447 def index_only? attr_get_ub1(OCI_ATTR_INDEX_ONLY) != 0 end |
#is_temporary? ⇒ Boolean
Returns true
if the table is a temporary table. Otherwise, false
.
390 391 392 |
# File 'lib/oci8/metadata.rb', line 390 def is_temporary? attr_get_ub1(OCI_ATTR_IS_TEMPORARY) != 0 end |
#is_typed? ⇒ Boolean
Returns true
if the table is a object table. Otherwise, false
.
395 396 397 |
# File 'lib/oci8/metadata.rb', line 395 def is_typed? attr_get_ub1(OCI_ATTR_IS_TYPED) != 0 end |
#num_cols ⇒ Integer
Returns number of columns
368 369 370 |
# File 'lib/oci8/metadata.rb', line 368 def num_cols attr_get_ub2(OCI_ATTR_NUM_COLS) end |
#partitioned? ⇒ Boolean
Returns true
if the table is a partitioned table. Otherwise, false
.
440 441 442 |
# File 'lib/oci8/metadata.rb', line 440 def partitioned? attr_get_ub1(OCI_ATTR_PARTITIONED) != 0 end |
#tablespace ⇒ Integer
Returns a tablespace number the table resides in.
426 427 428 |
# File 'lib/oci8/metadata.rb', line 426 def tablespace __word(OCI_ATTR_TABLESPACE) end |
#type_metadata ⇒ OCI8::Metadata::Type or nil
Retruns an instance of OCI8::Metadata::Type if the table is an object table. Otherwise, nil
.
383 384 385 |
# File 'lib/oci8/metadata.rb', line 383 def (OCI8::Metadata::Type) if is_typed? end |