passing parameters to views (or alternative methods)?

Поиск
Список
Период
Сортировка
Искать

passing parameters to views (or alternative methods)?

От:
"Andrew Sher" <acs974@hotmail.com>
Дата:
Hi,

I'm new to the world of postgres and have a question which I've been 
struggling with. I'm developing an application using visual basic as the 
front end and I'm attempting to base a form on a query that produces one 
record from two joined tables, producing 8 total fields (4 from each table). 
The record is selected based on an ID number input earlier, producing a 
similar query to something like (assuming the id number was 6):

select table1.ID, table1.field2, table2.ID, table2.field2 from table1, 
table2 where table2.ID=table1.ID and table1.ID = 6).

Ideally, the user is then able to enter data into each field and have the 
new data updated to the proper underlying fields. Because updatable joins 
aren't supported, I was attempting to create a view that served the same 
purpose. The problem I am running into is I don't know how to limit the view 
to the one record I am trying to select via the ID number, which changes 
each time the program is run. In other words, I want to use the same view 
but be able to pass to it the ID number of the one record I want it to 
return. I was wondering if this is possible via views, and, if not, are 
there alternative ways to accomplish the task?

Thanks.

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

FAQ