Online Eiffel Documentation
EiffelStudio

Selection Access

Once you haveselected data from the database, it returns a set of rows containing queried columns values. Each row loaded with DB_SELECTION is stored in a DB_RESULT object. The easiest way to access the data is thus to refer to DB_RESULT objects themselves.

Note: Take a look at theDatabase/Eiffel objects Coupling to learn advanced data handling features.

To use DB_RESULT, process in 2 steps:

Retrieving DB_RESULT objects

DB_SELECTION class provides different ways to customize result loading:

Accessing content of DB_RESULT

A DB_RESULT object merely carries data retrieved from the database. You have to convert it to a DB_TUPLE to access data within the retrieved row conveniently, i.e. mostly the column values:

	selection: DB_SELECTION
	tuple: DB_TUPLE
	...
	create tuple
	tuple.copy (selection.cursor)
	if tuple.count >= 2 and then tuple.column_name (2).is_equal ("Firstname") then
		io.putstring (tuple.item (2).out)
	end

See Also
Performing a database selection.
Coupling database data and Eiffel objects.