mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 15:22:31 +01:00
Author:halw
Date:2008-12-04T22:10:15.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@118 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -38,7 +38,7 @@ You can then access or modify [[ref:libraries/store/reference/db_table_flatshort
|
||||
<code>
|
||||
tablerow: DB_TABLE
|
||||
...
|
||||
display_attribute (code: INTEGER) is
|
||||
display_attribute (code: INTEGER)
|
||||
-- Display attribute with `code'.
|
||||
do
|
||||
io.putstring (tablerow.table_description.attribute (code).out)
|
||||
@@ -74,7 +74,7 @@ Basic database metadata is also available: the <eiffel>DB_SPECIFIC_TABLES_ACCESS
|
||||
<code>
|
||||
tables: DB_SPECIFIC_TABLES_ACCESS
|
||||
...
|
||||
new_object (code: INTEGER): DB_TABLE is
|
||||
new_object (code: INTEGER): DB_TABLE
|
||||
-- New object of table with `code'.
|
||||
do
|
||||
Result := tables.obj (code)
|
||||
|
||||
@@ -35,7 +35,7 @@ Every interface class inherits from the <eiffel>HANDLE_USE</eiffel> class and ca
|
||||
|
||||
The creation procedure for a <eiffel>DB_CHANGE</eiffel> object is for instance:
|
||||
<code>
|
||||
make is
|
||||
make
|
||||
-- Create an interface object to change active base.
|
||||
do
|
||||
implementation := handle.database.db_change
|
||||
@@ -68,7 +68,7 @@ The corresponding code looks like:
|
||||
session_status: DB_STATUS
|
||||
-- A session management object reference.
|
||||
...
|
||||
set_base is
|
||||
set_base
|
||||
...
|
||||
update_handle
|
||||
if session_status = Void then
|
||||
|
||||
@@ -34,7 +34,7 @@ Using the table information, [[ref:/libraries/store/reference/db_repository_flat
|
||||
...
|
||||
feature -- Settings
|
||||
|
||||
set_id (an_id: INTEGER) is
|
||||
set_id (an_id: INTEGER)
|
||||
-- Set an_id to id.
|
||||
do
|
||||
id := an_id
|
||||
|
||||
@@ -16,7 +16,7 @@ Template queries are parsed to replace each variable by its bound value. To crea
|
||||
Variables syntax is simple: the ':' special character followed by the variable name.
|
||||
<code>
|
||||
selection: DB_SELECTION
|
||||
Bind_var: STRING is "firstname"
|
||||
Bind_var: STRING = "firstname"
|
||||
...
|
||||
create selection.make
|
||||
selection.set_query ("Select * from CONTACTS where Firstname = ':" + Bind_var + "'")
|
||||
|
||||
@@ -55,12 +55,12 @@ To use DB_RESULT, process in 2 steps:
|
||||
execute, found
|
||||
end
|
||||
...
|
||||
execute is
|
||||
execute
|
||||
do
|
||||
i := i + 1
|
||||
end
|
||||
...
|
||||
found: BOOLEAN is
|
||||
found: BOOLEAN
|
||||
do
|
||||
Result := i >= Max_result
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user