Skip to content

Use select inside ‘filename’ property of utl_file.fopen

I have a procedure that extracts data from a view and stores it on disc in CSV format. I’d like a name of the file to contain the most recent timestamp from table MY_TIMESTAMPS. For now it looks like this: The part with (select to_char(max(EVENT_TS)) from MY_TIMESTAMPS) throws an error. How can I set th…

Count the number of times word appears in a single column

I’m attempting to count the number of times apples and oranges appear in my fruit column. The table looks like this: Expected output: My code thus far. I’m not sure how to do it when both appear and how to add them to the totals. I’m sure there is an easier way that this. Cheers Answer If th…