Parsing a field and performing a lookup

mcgrcoAgain

Registered User.
Local time
Tomorrow, 03:47
Joined
Jan 26, 2006
Messages
47
Hi there,

In my table one field has several codes to relect the fact that on equity can be listed on multiple indecies. It looks like this

;2;5;1;1;GF;1;LX;1;GD;1;SE;1;GB;


I have a table which contains all of these codes and a yes no flag. What is the best way of parsing this information and performing the lookup without needing to generate a new record for each of the index codes

What would be the best way of doing this?

Any help or tips would be appreciated.

regards
Conor
 
You have a many to many relationship. The proper way to store this data is to use a junction table between your main table and the index table. Storing multiple items of data in the same field is always a bad move.
 
Thanks Neil,

Unfortunatly that how the data is sent to me. I have no control over this. I need to find some way of extract these one by one and look them up on the index table
 
The data is sent to you that way ... and that is fine ... but it sounds like you are trying to push that information into a different (local) table ... What is the structure of the destination if that is indeed what you are doing?
 
I think the split function may help you on your way.
 

Users who are viewing this thread

Back
Top Bottom