i have create function like this
create or replace FUNCTION F_SUMMARY_LEAVE (
p_empid IN NUMBER
)
RETURN varchar2
AS
l_sql varchar2(8000);
BEGIN
l_sql := 'select * from employee where empid = ' || p_empid;
RETURN l_sql;
END F_SUMMARY_LEAVE;
/
and use on PL/SQL Function Body returning SQL Query like this
DECLARE
l_empid NUMBER := :APP_USER;
l_sql varchar2(8000);
BEGIN
l_sql := F_SUMMARY_LEAVE(l_empid);
return l_sql;
END;
bur error ORA-20999: Parsing returned query results in "ORA-20999: Failed to parse SQL query! ORA-06550: line 4, column 4: ORA-00936: missing expression".
how to fix this
thank you.