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



132
133
134
135
136
137
138
# File 'lib/plsql/connection.rb', line 132

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

#fetch_hashObject

Fetch row from cursor as hash => value, …



150
151
152
# File 'lib/plsql/connection.rb', line 150

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

#fetch_hash_allObject

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



141
142
143
144
145
146
147
# File 'lib/plsql/connection.rb', line 141

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