I am trying to convert Tom Kyte's print_table procedure from a stored procedure to a PL/SQL script that lives on my computer
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1035431863958
I do not have permission to store my own procedures on the servers on which I work, so I need to try it this way. My goal is to have a print_table script such that when I run it, I can pass it the filename of another script "script-A" on my computer, and it will take the output of script-A and write it to a file with vertical pipes "|" delimiting the columns. the print_table script has to be able to figure out the column names from script-A, write those column names and then write all of the data.
for example
@c:\sql\print_table c:\sql\end-of-month.sql
where end-of-month.sql is just a "regular" sql or pl/sql script.
I don't want the whole solution--I'd rather figure it out myself. Right now, I am just stuck on the how do I get one script to call another and how am I able to use the output of the other script (perhaps as a cursor?) I tried searching for it, but I couldn't come up with the right set of keywords.
That being said, if someone has first hand knowledge that what I am doing is impossible, that type of feedback would be appreciated so that I don't waste a bunch of time trying to make it work.