By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,834 Members | 2,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,834 IT Pros & Developers. It's quick & easy.

Is there something like an dynamic view ?

P: n/a
Hi,

I'd like to fetch a selection of records out of a big n:m-relation.
It's something like:
customers (c_id, c_name, c_address, ....);
projects (p_id, p_name, c_start, ....);
cp_relation (c_id, p_id, status_id, ....);

I use Access2000 as client.
The user selects an project_id by a combobox in the customer form. Then
the form should limit it's scope to only those customers that relate to
this project. The form's recordsource should be a SELECT that fetches
just the relevant customer-ids and collects the individual customer's
data when his id is current record.

I'd rather not let Access do the SELECT locally because then the whole
cp_relation had to be transferred.
A postgres-view would be as far as I know static. That is I'd need a
seperate view for every project. That's possible but seems a bit unelegant.
It would be:
view1 : SELECT c_id FROM cp_relation WHERE p_id = 1;
view2 : SELECT c_id FROM cp_relation WHERE p_id = 2;
view3 : SELECT c_id FROM cp_relation WHERE p_id = 3;
....

That screams for a parameter.
Is this possible ?
Thanks for reading so far
Andreas

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.