|  | Posted by James Fraser on 09/11/07 19:11 
I have run into a challenge that I'm not sure how to best solve. I'dappreciate any opinions or input.
 
 I am working with a third party database. They are storing some data
 that I need to use in a binary field. I've got the code to parse the
 binary and reconstruct what I need. Unfortunately, there might be
 multiple "entries" stored in a single binary field. a certain byte,
 let's just say the first, will always be the count of "entries" in
 this particular SQL entry.
 An example:
 then entry might be:
 0x01000012341234
 where 12341234 is the data entry that I will parse.
 Another possible entry is:
 0x03000012341234567856789ABC9ABC
 The first byte indicates that there are three data values I want to
 parse out:
 12341234
 56785678
 9ABC9ABC
 The portions of the binary I need are always the same length and there
 may be from 1 to ~100 of them. (usually 1 if it matters.)
 
 The big question:
 How could a SQL query return an entry for each of the "entries" in the
 binary field? For the second example I would want three entries in my
 results, each row returning a different section of the binary data.
 For the first, only one row. I'll be querying the set and expecting to
 get back more results than the number of entries in the set.
 
 I haven't really tried much with this yet, (other than some mental
 calisthenics were I fell down onto the mat pretty hard), so just some
 direction on where to begin would be helpful.
 
 
 (Yes, I understand that the difficulty is that this data shouldn't be
 stored this way, but there is not much I can do about that.)
 
 Thanks...
 James Fraser
 jbf1@concentric.net
  Navigation: [Reply to this message] |