comp.lang.ada
 help / color / mirror / Atom feed
* New ada user
@ 1997-04-21  0:00 od
  1997-05-11  0:00 ` Jacob Sparre Andersen
  0 siblings, 1 reply; 3+ messages in thread
From: od @ 1997-04-21  0:00 UTC (permalink / raw)



HI!I am a new ada user. I would like to create a database with
customers adresses, etc... but i really don't know how to manage and
above all how to start : create records, use them, search for one
information, etc... Any help is welcome. Thanks




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: New ada user
  1997-04-21  0:00 New ada user od
@ 1997-05-11  0:00 ` Jacob Sparre Andersen
  1997-05-13  0:00   ` Michael F Brenner
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Sparre Andersen @ 1997-05-11  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]


od (cnam05@univ-pau.fr) wrote:
| HI!I am a new ada user. I would like to create a database with
| customers adresses, etc... but i really don't know how to manage and
| above all how to start : create records, use them, search for one
| information, etc... Any help is welcome. Thanks

It sounds like you should use the package Ada.Direct_IO, if you plan to map
the database tables to a file.

It's probably a good idea to have a used/not used flag in your record. It 
could be done in this way:

   type File_Record (In_Use : Boolean := False) is
      record
         case In_Use is
            when True =>
               Name    : Name_Type;
               Address : Address_Type;
            when False =>
               null;
         end case;
      end record;

Then you overwrite a record with a File_Record'(In_Use => False) to delete
it.
When you want to insert a new record, you can first look for records, where
In_Use is False, otherwise you'll have to write the new record at the end
of the file.

Greetings,

Jacob
--
Jacob Sparre Andersen                            http://www.nbi.dk/%7Esparre/
Center for Chaos and Turbulence Studies          Phone: (+45) 39 65 53 51
The Niels Bohr Institute                                (+45) 35 32 53 05
--
G�r dine X-programmer danske - p� 5 minutter: http://www.nbi.dk/~nordfalk/ovs/




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: New ada user
  1997-05-11  0:00 ` Jacob Sparre Andersen
@ 1997-05-13  0:00   ` Michael F Brenner
  0 siblings, 0 replies; 3+ messages in thread
From: Michael F Brenner @ 1997-05-13  0:00 UTC (permalink / raw)



od (cnam05@univ-pau.fr) wrote:
| HI!I am a new ada user. I would like to create a database with
| customers adresses, etc... but i really don't know how to manage and
| above all how to start : create records, use them, search for one
| information, etc... Any help is welcome. Thanks

One way to create records is with SQL statements from the ANSI Standard 
SQL (1987) or ISO SQL2 (1992) or the draft ISO X3H2-94-329 SQL-3 and by
embedding the SQL statements in an Ada-95 program, perhaps using ANSI X3.168,
or other methods of embedding, or interfacing (like an object request
broker or SQL gateway. Then you manage records using the
normal INSERT, UPDATE, DELETE, DEFINE TABLE, and SELECT technology used
in ordinary commercial databases like Knowledgeman, Oracle, Sybase, DB2,
XDB, Access, or any of the other commonly available database management
systems. Another way to do it is to program an object which simulates
a commercial database by providing methods like insert, update, delete,
and a simple select. These simple databases should normally be replaced
by SQL systems as soon as they are noticed, especially if the language
in which they are implemented begins with the letter C, such as 
C, C++, and Cobol, because most of the y2k bugs and most of the software
maintenance money we spend goes to mouse hangs and data errors in
languages beginning with the letter C.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-05-13  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-21  0:00 New ada user od
1997-05-11  0:00 ` Jacob Sparre Andersen
1997-05-13  0:00   ` Michael F Brenner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox