Parse a text file in PLSQL?
I have a need to parse a multi line text file and run a procedure for each line. Essentially, I'm trying to add back uses to a cloned database.
The text file would look like this:
JOHNDOE#DEVELOPER
JANEDOE#DEVELOPER
What I would like to do is parse that file line by line, assign variables for username and role and then for each line, add the user and assign the role.
I'm fairly new to PLSQL so I would appreciate any help. My environment is Oracle Enterprise Database 12.1.0.2 running on Redhat 7.
I was easily able to do this by creating an array variable in a shell script and then logging onto the database for every row but I thought it would be a lot better to log on once and parse the file rather that parse the file and log on for each row.