HI,
How to append following child parts to main sql (select statement)?
PROCEDURE DisplayEmpPect (
input_Type IN VARCHAR2,
resultset OUT cur_ga
)
IS
BEGIN
OPEN resultset FOR
If input_Type = "A" Then
SELECT SUM (E.Salary) AS Sal
FROM HEMP E
ELSE If input_Type = "B" Then
WHERE E.EMP = 'ALL'
ELSE
WHERE E.EMP = 'ALL'
AND E.Type = 'Cont'
END IF
END;
Note: The query that I gave in procedure is not actual query, actual query is very big and has many conditions in it. I just need an idea
to append query parts to main select based on conditions.
Thanks