1. Indexing and Data Files

I know this has been asked MANY times before, but I can't seem to
keep up with the answers I printed out.  So, I'll ask it once more.

     I am working on several projects that need database handling.  My
question is this:  Has anyone developed a library or set of routines for
file handling in a database, or do I need to write my own routines.  What I
am in need of at this time is this:

  [Category] [Sub-Category] [Field1] [Field2] [Field3].....[FieldN]

     I need to have the DataBase indexed by Category and Sub-Category.  For
example.

[Category] = Mystery
[Sub-Category] = Fiction
[Field1] = The Haunted House
[Field2] = Joe Smith
[Field3] = A story about and old Haunted House

[Category] = Mystery
[Sub-Category] = Non-Fiction
[Field1] = The Missing Maid
[Field2] = Janet Grey Brown
[Field3] = The case of the Missing Maid, an unsolved mystery, that occured
           in the house of the author when she was a teenager
[Field4] = 24.95

[Category] = Sci-Fiction
[Sub-Category] = Play
[Field1] = The Attack of The Thirty Foot Green Thing
[Field2] = Jack Malloy
[Field3] = A very fast moving action packed story about a thirty foot tall
           green monster from outer space that attacks an earth space
           station, and then starts to move on a course that leads straight
           to earth.  None of the weapons known to man seems to have any
           effect what so ever on this monster, and it will arrive at the
           planet earth in less than 2 hours.  Oh My, what ever will man
           do?

and so on.  I would like to be able to sort the Database by Category and
Sub-Category, and be able to retrieve any record I want.  Also, I need to
be able to add records and have them sorted in the index in the proper
order.  Kind of like most DataBase programs, that contain an index that
points to the proper record in the file.  As you can see the number of
fields and length of the fields may vary.  Any help with this would be
helpfull.  I glanced at the DBF-Engine in the archives, but that did not
include the indexing, which is the very important part.

Thanks In Advance,

+ + + Rev. Ferlin Scarborough  -  Centreville, Alabama  -  USA

new topic     » topic index » view message » categorize

2. Re: Indexing and Data Files

----- Original Message -----
From: Rev. Ferlin Scarborough <ferlin at SANDW.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, December 27, 1999 12:59 AM
Subject: Indexing and Data Files


> I know this has been asked MANY times before, but I can't seem to
> keep up with the answers I printed out.  So, I'll ask it once more.
>
>      I am working on several projects that need database handling.

Like your email archives? blink

>My
> question is this:  Has anyone developed a library or set of routines for
> file handling in a database, or do I need to write my own routines.  What
I
> am in need of at this time is this:

Well, sorta. Mirctoks.e can do the sorting for the categories once you get
them from a file, which is easy enough. Gettok() or parse() come to mind. If
you use <> rather than [], getxml() can also do it,, again , in mirctoks.e,,
which may be on the Eu web page,, if not, i'll put it up as part of the
mirc-Eu package once everyone gets back to me on how (un)happy they are
about it. Calls to mirctoks getxml(dataseq,Field3,/,1) would return the data
from the first <Field3>data</Field3> no matter where it is, how long it, or
if it is in dataseq. Getxml(dataseq,Field3,/,0) will tell you how many
Field3 are in it. It works only on flat sequences, no nests.


>   [Category] [Sub-Category] [Field1] [Field2] [Field3].....[FieldN]
>
>      I need to have the DataBase indexed by Category and Sub-Category.
For
> example.
>
> [Category] = Mystery
> [Sub-Category] = Fiction
> [Field1] = The Haunted House
> [Field2] = Joe Smith
> [Field3] = A story about and old Haunted House
>
> [Category] = Mystery
> [Sub-Category] = Non-Fiction
> [Field1] = The Missing Maid
> [Field2] = Janet Grey Brown
> [Field3] = The case of the Missing Maid, an unsolved mystery, that occured
>            in the house of the author when she was a teenager
> [Field4] = 24.95
>
> [Category] = Sci-Fiction
> [Sub-Category] = Play
> [Field1] = The Attack of The Thirty Foot Green Thing
> [Field2] = Jack Malloy
> [Field3] = A very fast moving action packed story about a thirty foot tall
>            green monster from outer space that attacks an earth space
>            station, and then starts to move on a course that leads
straight
>            to earth.  None of the weapons known to man seems to have any
>            effect what so ever on this monster, and it will arrive at the
>            planet earth in less than 2 hours.  Oh My, what ever will man
>            do?
>
> and so on.  I would like to be able to sort the Database by Category and
> Sub-Category, and be able to retrieve any record I want.  Also, I need to
> be able to add records and have them sorted in the index in the proper
> order.  Kind of like most DataBase programs, that contain an index that
> points to the proper record in the file.  As you can see the number of
> fields and length of the fields may vary.  Any help with this would be
> helpfull.  I glanced at the DBF-Engine in the archives, but that did not
> include the indexing, which is the very important part.

I haven't written sorting either, and have no plans to do so.

Kat

new topic     » goto parent     » topic index » view message » categorize

3. Re: Indexing and Data Files

>     I am working on several projects that need database handling.  My
>question is this:  Has anyone developed a library or set of routines for
>file handling in a database, or do I need to write my own routines.  What I
>am in need of at this time is this:
>
>  [Category] [Sub-Category] [Field1] [Field2] [Field3].....[FieldN]
>
>     I need to have the DataBase indexed by Category and Sub-Category.  For
>example.
<<SNIP>>

Sadly nothing like this is being done in Euphoria.  I do, however, happen
to have a library for reading and writing fixed-length files, which sounds
like it's part of what you will need.  (I wouldn't have the foggiest idea
of how to index a variable-length index)  It is called fileman.e, and you
can find on my website at http://2fargon.hypermart.net/.

I did start work on a btrieve library for Eu, but it never came to
fruition, mostly because I recoiled in horror at the thought of converting
that many lines of C code...

As a VERY simple index, you could make a file with room for two atoms
tacked on to the end - one for a pointer to the previous record in the
index, and a pointer to the next record in the index.  You could then use
those values to seek() to the next record in the index.  It's not elegant,
but it does work.

I'm afraid that you'll end up having to "roll yer own" for most all of
these I/O routines.  I'm already streched pretty thin, but I'd be happy to
help you out where I can.

Brian

new topic     » goto parent     » topic index » view message » categorize

4. Re: Indexing and Data Files

On Mon, 27 Dec 1999, you wrote:
> I know this has been asked MANY times before, but I can't seem to
> keep up with the answers I printed out.  So, I'll ask it once more.
>
>      I am working on several projects that need database handling.  My
> question is this:  Has anyone developed a library or set of routines for
> file handling in a database, or do I need to write my own routines.

That's all I have been doing lately - database handling. I haven't found
a library that helps.

First thing, however, is to consider whether or not you can fit
all your data into memory. If so, then the Euphoria routines to
search and sort, etc. are fairly trivial, and performance is excellent. You
can fit a lot of data into 32 or 64 megs, you know. I'll be glad to share the
code I have.

If your data files are going to be larger, then there's little choice but to
design with fixed-length fields and block read/write functions.
Indexing isn't difficult to implement, but maintaining the indexes thru
deletions, insertions, and modifications may be a bigger task than you are
willing to take on. Unless your data files are HUGE, it's easier to just
re-index each time you make a change.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: Indexing and Data Files

Thanks to all who responded to my inquiry, Kat, Brian and Irv.
I'll hop on and take a gander at fileman and MircToks, I printed out the
messages, and placed them in thier own personal notebook, so I should be
able to keep track of them this time.

     Irv, sounds like you may be doing some of the same type of things that
I will be needing in my various projects.  ANY Code that you could pass on
to me, as far as file handling goes would be GREATLY APPRECIATED.

     Thanks again to all.

Later,

+ + + Rev. Ferlin Scarborough  -  Centreville, Alabama  -  USA

Mailto:ferlin at sandw.net

new topic     » goto parent     » topic index » view message » categorize

6. Re: Indexing and Data Files

From: Rev. Ferlin Scarborough <ferlin at SANDW.NET>

Subject: Re: Indexing and Data Files


> Thanks to all who responded to my inquiry, Kat, Brian and Irv.
> I'll hop on and take a gander at fileman and MircToks, I printed out the
> messages, and placed them in thier own personal notebook, so I should be
> able to keep track of them this time.

You may also want to look at Fabio Ramirez' Euphoria client for mySql, which
is
a generally free and very stable database server which runs under Windows
and Linux.  I've just started experimenting with it, so can't say more yet.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

7. Re: Indexing and Data Files

Rev. Ferlin Scarborough writes:

>I know this has been asked MANY times before, but I can't seem to
>keep up with the answers I printed out.  So, I'll ask it once more.
>
>     I am working on several projects that need database handling.  My
>question is this:  Has anyone developed a library or set of routines for
>file handling in a database, or do I need to write my own routines.  What I
>am in need of at this time is this:
>
>  [Category] [Sub-Category] [Field1] [Field2] [Field3].....[FieldN]
>
>     I need to have the DataBase indexed by Category and Sub-Category.  For
>example.
>
>[Category] = Mystery
>[Sub-Category] = Fiction
>[Field1] = The Haunted House
>[Field2] = Joe Smith
>[Field3] = A story about and old Haunted House
>
>[Category] = Mystery
>[Sub-Category] = Non-Fiction
>[Field1] = The Missing Maid
>[Field2] = Janet Grey Brown
>[Field3] = The case of the Missing Maid, an unsolved mystery, that occured
>           in the house of the author when she was a teenager
>[Field4] = 24.95
>
>[Category] = Sci-Fiction
>[Sub-Category] = Play
>[Field1] = The Attack of The Thirty Foot Green Thing
>[Field2] = Jack Malloy
>[Field3] = A very fast moving action packed story about a thirty foot tall
>           green monster from outer space that attacks an earth space
>           station, and then starts to move on a course that leads straight
>           to earth.  None of the weapons known to man seems to have any
>           effect what so ever on this monster, and it will arrive at the
>           planet earth in less than 2 hours.  Oh My, what ever will man
>           do?
>
>and so on.  I would like to be able to sort the Database by Category and
>Sub-Category, and be able to retrieve any record I want.  Also, I need to
>be able to add records and have them sorted in the index in the proper
>order.  Kind of like most DataBase programs, that contain an index that
>points to the proper record in the file.  As you can see the number of
>fields and length of the fields may vary.  Any help with this would be
>helpfull.  I glanced at the DBF-Engine in the archives, but that did not
>include the indexing, which is the very important part.
>
>Thanks In Advance,
>
>+ + + Rev. Ferlin Scarborough  -  Centreville, Alabama  -  USA
>

I've been thinking for some time of having a database as my first full-scale
application for Object Euphoria--the design I have in mind would handle
indexing as well as many other DB functions.  Ferlin's letter has inspired
me to start writing code.

--Mike Nelson

new topic     » goto parent     » topic index » view message » categorize

8. Re: Indexing and Data Files

Hi Mike,

Mike Nelson wrote:

[...]

>
> I've been thinking for some time of having a database as my first full-scale
> application for Object Euphoria--the design I have in mind would handle
> indexing as well as many other DB functions.  Ferlin's letter has inspired
> me to start writing code.
>
> --Mike Nelson

I'm doing some work on database indexing. Maybe we can share some thoughts about
it.


Marcel

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu