Class: OCI8::Metadata::Table

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

Overview

Instance Method Summary collapse

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.

Returns:

  • (Boolean)


442
443
444
# File 'lib/oci8/metadata.rb', line 442

def clustered?
  attr_get_ub1(OCI_ATTR_CLUSTERED) != 0
end

#columnsarray of OCI8::Metadata::Column

Returns column information of the table.

Returns:



463
464
465
# File 'lib/oci8/metadata.rb', line 463

def columns
  @columns ||= list_columns.to_a
end

#dbaInteger

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)


428
429
430
# File 'lib/oci8/metadata.rb', line 428

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.

Returns:

  • (:transaction, :session or nil)


415
416
417
# File 'lib/oci8/metadata.rb', line 415

def duration
  __duration
end

#index_only?Boolean

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

Returns:

  • (Boolean)


456
457
458
# File 'lib/oci8/metadata.rb', line 456

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.

Returns:

  • (Boolean)


399
400
401
# File 'lib/oci8/metadata.rb', line 399

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.

Returns:

  • (Boolean)


404
405
406
# File 'lib/oci8/metadata.rb', line 404

def is_typed?
  attr_get_ub1(OCI_ATTR_IS_TYPED) != 0
end

#num_colsInteger

Returns number of columns

Returns:

  • (Integer)


377
378
379
# File 'lib/oci8/metadata.rb', line 377

def num_cols
  attr_get_ub2(OCI_ATTR_NUM_COLS)
end

#partitioned?Boolean

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

Returns:

  • (Boolean)


449
450
451
# File 'lib/oci8/metadata.rb', line 449

def partitioned?
  attr_get_ub1(OCI_ATTR_PARTITIONED) != 0
end

#tablespaceInteger

Returns a tablespace number the table resides in.

Returns:

  • (Integer)


435
436
437
# File 'lib/oci8/metadata.rb', line 435

def tablespace
  __word(OCI_ATTR_TABLESPACE)
end

#type_metadataOCI8::Metadata::Type or nil

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

Returns:



392
393
394
# File 'lib/oci8/metadata.rb', line 392

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