Evaluate : Call Function

Good afternoon ..
Have a look at the column JUNK.













It has spaces,special characters. 
I would not want to see them - I want the plain text.
Let us write one function in oracle.



CREATE OR REPLACE FUNCTION RMV ( A VARCHAR2 )
RETURN VARCHAR2 is
B VARCHAR2(50);
BEGIN
SELECT regexp_replace((regexp_replace(A,'([[:punct:]])')),'[[:blank:]]') INTO B
FROM DUAL;
RETURN(B);
END;
/

Now I will call this function in the front end via EVALUATE function.












Let us keep both the columns side by side and we will see the difference.











The same effect can be achieved by nesting the evaluate function
 ( This is nothing but the expression we used in the function above ) 
Since we are using evaluate - we need to be very careful about spaces,single quotes and its syntax.


Have a look at - 
















Have a nice day.


No comments: