I need to consume a file that is being generated on an Oracle server and I have been told to get it using the UTL_FILE package. I intend on consuming the file in a groovy script and have a connection to the database. It is a simple text file and I’d like to pull it down to the server and consume it as I would any other text file but I suppose I am willing to read the data from some cursor if that is what needs to happen.
I am unfamiliar with PL/SQL and UTL_FILE. Does anyone know of a good way to do this?
Depends on the size of the file. If it is relatively small, then a stored procedure can read it all into one large field (VARCHAR2, CLOB or BLOB) and return that as a value.
Could also be worth looking into external tables where you can select from the file just as if it was a plain database table.