By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create or replace function traudit04011 (
XPARAM IN VARCHAR2)
return clob sql_macro as
sql_statement varchar2(5000);
vc_condition varchar(1000);
p_search_by1 varchar(100) := '';
begin
IF XPARAM is not NULL THEN
DBMS_OUTPUT.PUT_LINE('TRUE');
ELSE
DBMS_OUTPUT.PUT_LINE('FALSE');
END IF;
sql_statement := 'select traudit04011.XPARAM d1 from dual'; -- In real world, instead of XPARAM there will be a variable storing dynamic query
return sql_statement;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.put_line('error');
end;
/
select * from traudit04011('This is a parameter that always returns null');
D1 |
---|
This is a parameter that always returns null |