Hi,
I've created a function and if you run the function on a whole table eg
(select ActivityScaleValueConv_Funct(JobNumber) from WPERIODIC)
it returns the correct values for all the entries in the table,
But if you run it on one value eg
(select ActivityScaleValueConv_Funct(2222) from WPERIODICFINAL)
it returns a entry (the same) for all the entries in the table, and I need it to only return the value for the one entry I am looking for.
The function is at the bottom, any help will be appreciated.
The function looks as followes:
CREATE OR REPLACE FUNCTION ScaleValueConv_Funct (Job_Number IN Varchar2)
RETURN NUMBER
IS SCALEVAL NUMBER(20,2);
BEGIN
SELECT SUM(E.revenuerecognizedbas) INTO SCALEVAL
FROM JEntry E
WHERE E.JOBNUMBER = Job_Number
AND E.ActNumber = '9002'
AND E.FEDate < '&1';
RETURN(SCALEVAL);
END;
I've created a function and if you run the function on a whole table eg
(select ActivityScaleValueConv_Funct(JobNumber) from WPERIODIC)
it returns the correct values for all the entries in the table,
But if you run it on one value eg
(select ActivityScaleValueConv_Funct(2222) from WPERIODICFINAL)
it returns a entry (the same) for all the entries in the table, and I need it to only return the value for the one entry I am looking for.
The function is at the bottom, any help will be appreciated.
The function looks as followes:
CREATE OR REPLACE FUNCTION ScaleValueConv_Funct (Job_Number IN Varchar2)
RETURN NUMBER
IS SCALEVAL NUMBER(20,2);
BEGIN
SELECT SUM(E.revenuerecognizedbas) INTO SCALEVAL
FROM JEntry E
WHERE E.JOBNUMBER = Job_Number
AND E.ActNumber = '9002'
AND E.FEDate < '&1';
RETURN(SCALEVAL);
END;