General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>* There is no relation between the two tables via a primary key and candidate key. The relationship between the two tables is many-to-many.
>
>Example: an office has many voters and voters can be associated with many offices.
>
How are they associated? Usually a many-to-many relationship has a third linking table. Without seeing a schema this is hard to envision.
>**I am trying to accomplish the following:
>
>I have a search form that selects a specific office and fires my offices form. When the user arrives to this office form, he/she can view all the detials of the specific office selected.
>
>I am trying to add a new feature to this form. I want to include a grid on this offices form that provides voter demographic information, for each office. Now, our company knows that we have to build thousands of views to extract voters information [one for each office], in order to set filters on the voters to only bring up the voters that can vote in the specific office "district" that was selected by a user on the search form.
I don't understand this relationship... are you saying each office has many districts? Or, is an office and a district the same entity but a different candidate key?
>Here is the trick>> To have the grid be populated with voter information for that specific office without having a linking key. We know what voters are associated with a specific office based on a district number.
>
If voters are associated with an office based on district number, that sounds like a relationship to me. You shouldn't need 'hundreds' of views, you need one view on the voters table with a filter like...
v_voters.district == ?v_office.district
Is that not the relationship for what you are doing? As you move through the v_office view, you requery the voters view which will be populated with voters in that offices' district. What am I missing?
>Thank in advance for any comments or ideas on this situation.
HTH,
BOb
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only