Hi All,
As per the requirement, in a stored procedure ii need to build a dynamic where based on the input parameter.
Example below explained.
DECLARE
l_sysdate varchar2(100);
l_condition VARCHAR2(1000);
l_input_parameter varchar2(100);
BEGIN
IF l_input_parameter ='X' THEN
l_condition :='WHERE 1=1';
ELSE
l_condition :='WHERE 1=1';
END IF;
SELECT SYSDATE INTO l_sysdate from dual ||l_condition ;
DBMS_OUTPUT.PUT_LINE('l_sysdate '||l_sysdate);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('WHEN OTHERS '||SQLERRM);
END;
In the above example assuming that l_input_parameter is input parameter based on this i need to concatenate to the below sql.
Please confirm if it is possible.
Regards
N