Database Selection

Use the DB_SELECTION class to select data from the database. Once you have selected the data, you can access it with convenience using adaptative EiffelStore structures.

Note: Take a look at the Database/Eiffel objects Coupling if you need information about your database structure.

DB_SELECTION enables your application to get database content using SQL 'select' queries:

  • You can carry out 'select' queries in an intuitive way using directly the SQL language:

selection: DB_SELECTION -- Selection tool ... create selection.make selection.set_query ("select * from CONTACTS where firstname = 'John'") -- Set query text selection.execute_query -- Execute query ... -- Process query results selection.terminate -- Clear database cursor

Tip:
1) Always check the database status for errors after your 'select' query.
2) EiffelStore supports a finite number of concurrent queries. Call {DB_SELECTION}.terminate to free resources from a completed query.

See Also:
Binding variables in a database query.
Coupling database objects with Eiffel objects.
Accessing selected data from the database.

cached: 12/21/2024 11:58:59.000 AM