Class: FireRuby::ResultSet

Inherits:
Object
  • Object
show all
Defined in:
lib/src.rb

Overview

This class represents the results of a SQL query executed against a database.

Instance Method Summary collapse

Constructor Details

#initialize(statement) ⇒ ResultSet

This is the constructor for the ResultSet object.

Parameters

statement

A reference to the Statement object that the ResultSet will be based on.



554
555
# File 'lib/src.rb', line 554

def initialize(statement)
end

Instance Method Details

#closeObject

This method releases the database resources associated with a ResultSet object and should be explicitly called when a ResultSet object is of no further use. The method is implicitly called if the rows available from a ResultSet are exhausted but calling this method at that time will not cause an error.

Exceptions

FireRubyError

Generated whenever a problem occurs closing the result set object.



663
664
# File 'lib/src.rb', line 663

def close
end

#column_alias(column) ⇒ Object

This method fetches the alias associated with a specified column for a ResultSet object.

Parameters

column

A reference to the column number to fetch the details for. Column numbers start at zero.



593
594
# File 'lib/src.rb', line 593

def column_alias(column)
end

#column_countObject

This method fetches a count of the number of columns in a row of data that the ResultSet can fetch.



569
570
# File 'lib/src.rb', line 569

def column_count
end

#column_name(column) ⇒ Object

This method fetches the name associated with a specified column for a ResultSet object.

Parameters

column

A reference to the column number to fetch the details for. Column numbers start at zero.



581
582
# File 'lib/src.rb', line 581

def column_name(column)
end

#column_table(column) ⇒ Object

This method fetches the table name associated with a specified column for a ResultSet object.

Parameters

column

A reference to the column number to fetch the details for. Column numbers start at zero.



605
606
# File 'lib/src.rb', line 605

def column_table(column)
end

#each(&block) ⇒ Object

This method provides an iterator for the (remaining) rows contained in a ResultSet object.

Parameters

block

A block that takes a single parameter. This will be called for and passed each remaining row (as per the fetch method) from the ResultSet.



648
649
# File 'lib/src.rb', line 648

def each(&block)
end

#exhausted?Boolean

This method is used to determine if all of the rows have been retrieved from a ResultSet object. This method will always return false until the fetch method has been called at least once so it cannot be used to detect a result set that returns no rows.

Returns:

  • (Boolean)


627
628
# File 'lib/src.rb', line 627

def exhausted?
end

#fetchObject

This method fetches a single rows worth of data from the ResultSet object. If the set contains more rows then an array containing the row data will be retrieved. If the ResultSet is exhausted (i.e. all rows have been fetched) then nil is returned. Translation of the row data into an appropriate Ruby type is performed on the row data that is extracted.



617
618
# File 'lib/src.rb', line 617

def fetch
end

#row_countObject

This method fetches a count of the total number of rows retrieved from a result set.



635
636
# File 'lib/src.rb', line 635

def row_count
end

#statementObject

This is the accessor for the statement attribute.



561
562
# File 'lib/src.rb', line 561

def statement
end