Hello,
I have a question regarding combining queries. We have this CMS
(Smartsite) for our website which has a meeting and a calendar module.
The module works with the following values;
nr, StartDate, EndDate, title
The nr-value is the unique pagenumber of the linked page. StartDate
and EndDate are obvious. Title is the name of the linked page which is
shown in the calendar as well.
The content is drawn out of a view called vwactive.
Parent is the pagenumber of which the current page is a child in the
hierarchy.
I had two calendars... one was filled with the meetings which came
from a meeting module an one was filled with other activities. The
department which has te work with those calendars asked me id I could
combiine the two calendars into one. Underneath you'll find the
seperate scripts I used to fill the calendars.
Could anyone give me a hint on how I should combine those two into
one?
MEETINGCALENDAR+++++++++++++++++++++++++++++++++++++++++++++++++++++
SELECT a.nr, bisMeetingDate as StartDate, bisMeetingDate as EndDate,
title, bisLocations.Name as Location, bisMeetingStart, showUntil,
showFrom,
(SELECT DISTINCT dbms_lob.substr(body,12,1) as link FROM vwActive c
WHERE c.parent=a.nr and hyperlink=1 and contenttype=9) as
BestuursorgaanNr,
(SELECT Title FROM vwActive b WHERE Nr=(SELECT DISTINCT
dbms_lob.substr(body,12,1) as link FROM vwActive c WHERE c.parent=a.nr
AND hyperlink=1 and contenttype=9)) as Bestuursorgaan
FROM vwActive a, bisLocations
WHERE bisLocations.Nr=bisLocation AND
Parent=[Vergadering] AND
ContentType=9
ACIVITITIES CALENDER (This is the regular usage)++++++++++++++++++++
SELECT nr, StartDate, EndDate, title, showUntil, showFrom from
vwActive
WHERE Parent=6582
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks in advance!
Marco
m.hoefman@lelystad.nl
Ben Thompson - 28 Dec 2004 10:50 GMT
Marco Hoefman asked:
> Could anyone give me a hint on how I should combine those two into
> one?
Simply by writing the word 'UNION' in between them? It will work
provided that the data types match in the two statements; if they do not
you will have to use a 'CAST'.
Ben.