I keep getting the ORA-00904 Invalid identifier error when I call my function in Oracle.
I'm wondering if oracle is being picky with dates and strings.
I have tried multiple combinations with passing the date instead of the string using to_date('01-JUN-2010','DD-MON-YYYY') in my function call and changing the input on the function to (fromdate IN DATE) with no luck
here is the call:
select .., fn_myfunction('01-JUN-2010') as Days_Unread from tablename;
here is my function:
CREATE OR REPLACE FUNCTION fn_myfunction
(fromDate IN varchar2
select count(*) into countval
from (select rownum rnum
where rownum <= to_date(sysdate) - to_date(fromDate)+1
where to_char( to_date(fromDate)+rnum-1, 'DY' ) not in ( 'SAT', 'SUN' );