Class: OCI8::Metadata::Table

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

Overview

Constant Summary

Instance Method Summary (collapse)

Methods inherited from Base

#obj_id, #obj_link, #obj_name, #obj_schema

Instance Method Details

- (Boolean) clustered?

Returns true if the table is part of a cluster. Otherwise, false.

Returns:

  • (Boolean)


451
452
453
# File 'lib/oci8/metadata.rb', line 451

def clustered?
  attr_get_ub1(OCI_ATTR_CLUSTERED) != 0
end

- (array of OCI8::Metadata::Column) columns

Returns column information of the table.

Returns:



472
473
474
# File 'lib/oci8/metadata.rb', line 472

def columns
  @columns ||= list_columns.to_a
end

- (Integer) dba

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.

Returns:

  • (Integer)


437
438
439
# File 'lib/oci8/metadata.rb', line 437

def dba
  attr_get_ub4(OCI_ATTR_RDBA)
end

- (:transaction, :session or nil) duration

Retruns :transaction if the table is a transaction-specific temporary table. :session if it is a session-specific temporary table. Otherwise, nil.

Returns:

  • (:transaction, :session or nil)


424
425
426
# File 'lib/oci8/metadata.rb', line 424

def duration
  __duration
end

- (Boolean) index_only?

Returns true if the table is an index-organized table Otherwise, false.

Returns:

  • (Boolean)


465
466
467
# File 'lib/oci8/metadata.rb', line 465

def index_only?
  attr_get_ub1(OCI_ATTR_INDEX_ONLY) != 0
end

- (Boolean) is_temporary?

Returns true if the table is a temporary table. Otherwise, false.

Returns:

  • (Boolean)


408
409
410
# File 'lib/oci8/metadata.rb', line 408

def is_temporary?
  attr_get_ub1(OCI_ATTR_IS_TEMPORARY) != 0
end

- (Boolean) is_typed?

Returns true if the table is a object table. Otherwise, false.

Returns:

  • (Boolean)


413
414
415
# File 'lib/oci8/metadata.rb', line 413

def is_typed?
  attr_get_ub1(OCI_ATTR_IS_TYPED) != 0
end

- (Integer) num_cols

Returns number of columns

Returns:

  • (Integer)


386
387
388
# File 'lib/oci8/metadata.rb', line 386

def num_cols
  attr_get_ub2(OCI_ATTR_NUM_COLS)
end

- (Boolean) partitioned?

Returns true if the table is a partitioned table. Otherwise, false.

Returns:

  • (Boolean)


458
459
460
# File 'lib/oci8/metadata.rb', line 458

def partitioned?
  attr_get_ub1(OCI_ATTR_PARTITIONED) != 0
end

- (Integer) tablespace

Returns a tablespace number the table resides in.

Returns:

  • (Integer)


444
445
446
# File 'lib/oci8/metadata.rb', line 444

def tablespace
  __word(OCI_ATTR_TABLESPACE)
end

- (OCI8::Metadata::Type or nil) type_metadata

Retruns an instance of OCI8::Metadata::Type if the table is an object table. Otherwise, nil.

Returns:



401
402
403
# File 'lib/oci8/metadata.rb', line 401

def 
  (OCI8::Metadata::Type) if is_typed?
end