Declaring a function in a WITH clause is not possible, but according to the information provided in OOW, it will be in version 12c. Therefore, at the moment you need to create a function as a schematic object, regardless of whether it is an autonomous function or part of a package. For instance:
create or replace function F(p_p in number) return number is begin return p_p + 1; end;
And then call it in the query, ensuring that the data type of the column that you pass to the function as a parameter has the same data type as the function parameter:
select f(col1) , f(col2) , ... , f(coln) from your_table
source share