I am working on an application that has a database table with two
repeating fields.  The table has several fields that are uniq, and the there
are two fields that occur 6 times i.e. a1, b1, a2, b2, ....., a6, b6.  This
table is populated and updated from a Perl script that parses a file.  All
of the uniq fields remain the same, but these last two fields can have up to
6 different values and I want to associate all 6 possibilities with this
single entry.  The original INSERT statement doesn't have to worry, it
simply enters the data into a1 & b1.  The problem arises when there is
another entry that needs to be made.
        Assuming that the file is processed for the first time, and the
first entry places a row of data into the table, all of the uniq fields are
populated along with a1 & b1.  The next match of the Primary Key, needs to
now place the non-uniq field data into a2 & b2.  Likewise, the subsequent
Primary Key match needs to place this data into fields a3 & b3.  This is the
problem I am having.  I am not really sure on how to script the logic to get
the data to be inserted into the next available a# & b# filed combination.
I could test each of the a# fields, but this seems like a lot of code.
        Any ideas on how to get the data into the next available field would
be most appreciated.  Unfortunately, I also have to figure out how to move
data around in the event that say all 6 non-uniq fields pairs are full, and
then the 3 & 4 field pairs are removed.  Maybe I don't even need to worry
about moving this data around.  Once again, any suggestions would be most
appreciated.  Thanks in advance.


Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com


Reply via email to