Subject | Parameters in views? |
---|---|
Author | Salvatore Besso |
Post date | 2005-03-20T18:53:15Z |
hello all,
is it possible to use parameters in view definitions? I have this SQL that
complains for a bad variable "CN" but that normally works if I remove the
parameter. I'm creating it with IB_Expert:
CREATE VIEW VW_Confirmed_By_Continent(
AT_Prefix,
Main_Dxcc_Prefix,
Dxcc_Entity_Name,
Continent,
Worked_Qso,
Confirmed_Qso)
AS
SELECT
E.AT_Prefix,
E.Main_Dxcc_Prefix,
E.Dxcc_Entity_Name,
C.Short_Name,
T.Worked_Qso,
T.Confirmed_Qso
FROM Dxcc_Entities E, Log L
JOIN Qso Q ON Q.Dxcc_Entity = E.ID_Dxcc_Entity
JOIN Dxcc_Totals T ON T.Dxcc_Entity = E.ID_Dxcc_Entity
JOIN Qso_Details D ON D.ID_Qso = Q.ID_Qso
JOIN Continents C ON C.ID_Continent = D.Continent
WHERE L.Own_Dxcc_Entity <> T.Dxcc_Entity AND T.Confirmed_Qso > 0 AND
C.Short_Name = :CN
GROUP BY E.AT_Prefix, E.Main_Dxcc_Prefix, E.Dxcc_Entity_Name, C.Short_Name,
T.Worked_Qso, T.Confirmed_Qso;
Regards
Salvatore
is it possible to use parameters in view definitions? I have this SQL that
complains for a bad variable "CN" but that normally works if I remove the
parameter. I'm creating it with IB_Expert:
CREATE VIEW VW_Confirmed_By_Continent(
AT_Prefix,
Main_Dxcc_Prefix,
Dxcc_Entity_Name,
Continent,
Worked_Qso,
Confirmed_Qso)
AS
SELECT
E.AT_Prefix,
E.Main_Dxcc_Prefix,
E.Dxcc_Entity_Name,
C.Short_Name,
T.Worked_Qso,
T.Confirmed_Qso
FROM Dxcc_Entities E, Log L
JOIN Qso Q ON Q.Dxcc_Entity = E.ID_Dxcc_Entity
JOIN Dxcc_Totals T ON T.Dxcc_Entity = E.ID_Dxcc_Entity
JOIN Qso_Details D ON D.ID_Qso = Q.ID_Qso
JOIN Continents C ON C.ID_Continent = D.Continent
WHERE L.Own_Dxcc_Entity <> T.Dxcc_Entity AND T.Confirmed_Qso > 0 AND
C.Short_Name = :CN
GROUP BY E.AT_Prefix, E.Main_Dxcc_Prefix, E.Dxcc_Entity_Name, C.Short_Name,
T.Worked_Qso, T.Confirmed_Qso;
Regards
Salvatore