Problemer med at kalde en procedure fra et stort select
jeg får fejl når jeg kører dette, kan ikke finde : SalgPrTimeGetKode !!!jeg kan godt lave en alm select * from SalgPrTimeGetKode(123456)
men ikke dette select :
select * from ( select e.*,
L."Type" as lintype,
( case when L."Type" = 'Recept' then cast(L."VareNr" as integer)
else 0 end )
as lbnr,
( case when L."Type" = 'Recept' then 'Ingen'
else "SalgPrTimeGetKode"( L."VareNr" ) end )
as kode,
L."Brutto",
L."Antal",
( case when L."Type" = 'Recept' then EkspDBPris( cast(L."VareNr" as integer) )
else DBPris( L."VareNr" ) end )
as DB
from ( SELECT K."BonNr",
cast(K."Dato" as date) as dato,
extract(hour from K."Dato") as tid,
K."BrugerNr"
FROM "KasseEkspeditioner" K
where cast(K."Dato" as date) >= cast('2013-10-22' as date) and
cast(K."Dato" as date) <= cast('2013-10-22' as date)
) as e left join "KasseLinier" as L on L."BonNr" = e."BonNr"
order by dato,brugernr,tid
) as xxx
where xxx."lintype" = 'Varelinie' or xxx."lintype" = 'Recept';