calling store procedure in Oracle9i [message #80472] |
Fri, 27 September 2002 06:30 |
chhan
Messages: 19 Registered: June 2002
|
Junior Member |
|
|
Hi All,
I have written a store procedure which calculate the day fine if owner is late with their payment. below is the code, which i execute in SQL *PLUS and got the message compile with no error.
Create or replace procedure DayFine1 (FID number, DateIn date) as
Day_FineTemp number;
Day_Fine number;
DatePaid Date;
begin
if DatePaid IS NULL then
Day_FineTemp := SysDate - DateIn;
if day_FineTemp >14 then
Day_Fine := 14;
else Day_Fine := Day_FineTemp;
end if;
end if;
Update tblFine
set DayFine=Day_Fine
where FineID = FID;
end;
i test the above in SQL PLUS, just to make sure it work by using:
execute DayFine1('19', '16-feb-2002');
I got the expected result, so i know my code is ok.
The problem is i want to call this procedure in my form, so i have created a button and in the WHEN-BUTTON-PRESSED TRIGGER, i entered the following:
BEGIN
:DayFine:=DayFine1(:tblEnterinto.FineID, :tblEnterInto.DateIn);
Execute_query;
select VehicleID
into :tblFine.VehicleID
from tblFine
where tblfine.VehicleID= :tblEnterInto.VehicleID;
Execute_query;
end;
The error i get when i pressed compile is:
NO FUNCTION WITH NAME DAYFINE1 EXISTS IN THIS SCOPE.
What have i done wrong? My store procedure IS DEFINITY CALLED DAYFINE1.
can anyone help.
thanks
chhan
|
|
|
Re: calling store procedure in Oracle9i [message #80473 is a reply to message #80472] |
Fri, 27 September 2002 12:02 |
visitor
Messages: 1 Registered: September 2002
|
Junior Member |
|
|
u have written a procedure..not a FUNCTION..procedures won't return any value..
:DayFine:=DayFine1(:tblEnterinto.FineID, :tblEnterInto.DateIn);
This portion of ur code is wrong.
Call the procedure like this
DayFine1(:tblEnterinto.FineID, :tblEnterInto.DateIn);
or make DayFine1 a FUNCTION..
|
|
|
|