Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View vs cursor
Message
 
 
À
25/02/2000 12:34:19
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00337628
Message ID:
00337676
Vues:
10
That is sort of what I am working towards, but the view is best explained by a (sorry) large copy, with comments added
This is what I really want, but of course it will not work:
SELECT Brupdt_view.room_num, Brupdt_view.floor, Brupdt_view.bldg_num,;
Brupdt_view.sex, Brupdt_view.smoking, Bedstbl.*, Brupdt_view.rm_type;
FROM sqms!brupdt_view LEFT OUTER JOIN sqms!bedstbl ;
ON Brupdt_view.room_key = Bedstbl.room_key;
WHERE Bedstbl.bed_key IS NOT NULL;&& actually returns NULLS!!!!!
AND Bedstbl.bed_key NOT IN (SELECT DISTINCT bed_key FROM data\bookingtbl WHERE BETWEEN(?m.arrive_date,bookingtbl.arive_date,bookingtbl.dept_date) ;
UNION(SELECT DISTINCT bed_key FROM data\occupantstbl WHERE BETWEEN(?m.arrive_date,occupantstbl.arrive_date,occupantstbl.dept_date));
UNION (Select DISTINCT bed_key from bedstbl where bedstbl.room_key = maint_view.room_key))
&& This is the exesting view
SELECT Brupdt_view.room_num, Brupdt_view.floor, Brupdt_view.bldg_num,;
Brupdt_view.sex, Brupdt_view.smoking, Bedstbl.*, Brupdt_view.rm_type;
FROM sqms!brupdt_view LEFT OUTER JOIN sqms!bedstbl ;
ON Brupdt_view.room_key = Bedstbl.room_key;
WHERE Bedstbl.bed_key IS NOT NULL;
AND Bedstbl.bed_key NOT IN (SELECT DISTINCT bed_key FROM data\bookingtbl ;
WHERE BETWEEN(?m.arrive_date,bookingtbl.arive_date,bookingtbl.dept_date)) AND ;
Bedstbl.bed_key NOT IN (SELECT DISTINCT bed_key FROM data\occupantstbl ;
WHERE BETWEEN(?m.arrive_date,occupantstbl.arrive_date,occupantstbl.dept_date))AND ;
&& This is sort of what needs to be added, join is a minor problem, but i can && build a higher view to make it work
Bedstbl.bed_key NOT IN (Select DISTINCT bed_key from bedstbl ;
WHERE bedstbl.room_key = maint_view.room_key)) ;

There is no need for update on the view, it is only to select available rooms to make a reservation. It is just that the users decided to add maintenence status part of the selection criterea, and did not mention maintence at design time.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform