Christian,

> this is an obvious 'newbie' question, so please bare with me.

If you had ever seen me without my clothes on, you would not be asking
me to do this!
Pardon me for joking at the expense of your English, but I've seen this
wording/spelling so often on the lists...
Bare = unclothed.
Bear = to carry a load.
Both pronounced the same way (homophones).
Hence "bear with me" means to help you while you do something, or
possibly that we should exercise forbearance (as you have just had to do
with me and my warped sense of humor).

> i'm parsing a lot of data from file, and a good deal of this data is
in the
> form of nested C structs.  within any given struct, you might have an
array
> of 256 floats, or an array of 256 structs, with 256 floats, etc, etc.
>
> i'd like to have one entry in the field column which can be accessed
by name
> and index.  i.e. fieldnameX(1), fieldnameX(2), etc. where the index is
the
> floating point value, a character string, or whatever in an array
within a
> struct.  how do i go about doing this, if it's at all possible? (it
would
> seem odd if i had to create n number of fields for each value in an
array.
> especially arrays of large sizes)  i'm not looking for the C/C++ or
Perl to
> SQL mechanism, i just haven't found the syntax to create a field of
that
> type in SQL, which is my first, and obvious starting point.

Relational algebra deals with data in sets (or "tables"). The repetition
structure is "rows". MySQL (and many other RDBMS) does not (yet) have
user defined data types, leave alone complex/grouped data types of this
nature. So-called object-oriented DBMS are starting to bring in these
ideas - which in turn encourages the RDBMS suppliers to move in those
directions.

However you could try to implement the proposals in your first paragraph
by merging (as far as possible) SQL's rows and existing data types with
the 256 floats structure, for example, eg a table of 256 rows with one
float value column. You could also think about serialising the C data
onto a single row with 256 columns, but I think that would be quite
unwieldy to implement (just off the top of my head).

Moving on to the second paragraph: life is going to get much more
complex. You could implement this by having a table with two columns:
the index with float or char data type, and the value in the second
column. Again, instead of multiplying the number of fields across a row,
I'd think instead of going 'down' the rows of a table. The retrieval
mechanism would presumably involve a search of the index column and the
retrieval of the row's/corresponding value field.

I'm not a C-prog. I hope I've not missed some subtlety about the way
things work in that language (feel free to 'take a shot' at my expense!)
I doubt the above are 'complete' answers for you, but if I can encourage
the thinking that got you so far, perhaps you can take it the rest of
the way?

Regards,
=dn
(with apologies if your sense of humor was offended)


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to