Kod: Tümünü seç
---------- STATEMENT ----------
CREATE VIEW NEW_VIEW ("deneme"
)
AS
SELECT sp_ilk_endeks.sonuc
FROM sp_ilk_endeks ('fueloil','fueloil');
Kod: Tümünü seç
---------- ERROR MESSAGE ----------
fmCompile.quCompile:
Unsuccessful execution caused by a system error that precludes
successful execution of subsequent statements.
Dynamic SQL Error.
feature is not supported.
Kod: Tümünü seç
CREATE PROCEDURE SP_ILK_ENDEKS (
TABLO_ADI VARCHAR (15),
TURU VARCHAR (15))
RETURNS (
SONUC INTEGER)
AS
declare variable ilk_endeks integer;
declare variable ton integer;
declare variable bolen integer;
BEGIN
execute statement 'select coalesce((select first 1 tablo2.deger from ' || tablo_adi || ' tablo2 where tablo2.tarih < tablo1.tarih order by tablo2.tarih desc),0)from ' || tablo_adi || ' tablo1'
into :ilk_endeks;
if (ilk_endeks=0) then
begin
select stok.mevcut from stok
where stok.turu=:turu
into :ton;
select d_carpan.deger from d_carpan where d_carpan.turu=:turu
into :bolen;
sonuc=:ton/:bolen;
end
else
begin
execute statement 'select coalesce((select first 1 tablo2.deger from ' || tablo_adi || ' tablo2 where tablo2.tarih < tablo1.tarih order by tablo2.tarih desc),0)from ' || tablo_adi || ' tablo1'
into :sonuc;
end
SUSPEND;
END