Module: PLSQL::Connection::CursorCommon

Included in:
JDBCConnection::Cursor, OCIConnection::Cursor
Defined in:
lib/plsql/connection.rb

Instance Method Summary collapse

Instance Method Details

#fetch_allObject

Fetch all rows from cursor, each row as array of values



157
158
159
160
161
162
163
# File 'lib/plsql/connection.rb', line 157

def fetch_all
  rows = []
  while (row = fetch)
    rows << row
  end
  rows
end

#fetch_hashObject

Fetch row from cursor as hash => value, …



175
176
177
# File 'lib/plsql/connection.rb', line 175

def fetch_hash
  (row = fetch) && ArrayHelpers::to_hash(fields, row)
end

#fetch_hash_allObject

Fetch all rows from cursor, each row as hash => value, …



166
167
168
169
170
171
172
# File 'lib/plsql/connection.rb', line 166

def fetch_hash_all
  rows = []
  while (row = fetch_hash)
    rows << row
  end
  rows
end