Trying to create an output file through a procedure but am unable to modify the init.ora to allow for utl_file_dir or create directory. Is there another way to accomplish this without creating a table and doing a simple spool, this unfortunately, is out the question, too.
Write to a file in PL/SQL without spools or utl_file
1.2k Views Asked by DEwok At
2
There are 2 best solutions below
2
kayakpim
On
If you have access to sqlplus then add dbms_output.put_line messages to the code and run it in sqlplus. Before running type:
spool <filename you want>
then
spool off
to close the file and stop writing.
Either that or using Java could be an option but you will need additional privileges to access the file system and compile a java method on the db.
You should really be given access to a directory on the filesystem. Speak to a dba and if there is a business requirement you should be able to make it happen.
Related Questions in SQL
- Can MVC.NET prevent SQL-injection at razor or controller level?
- SQL server not returning all rows
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Creating a parametrized field name for a SELECT clause
- Combine two rows based on common ID
- Column displays each count
- Slick query for one to optional one (zero or one) relationship
- Aggregate and count in PostgreSQL
- MAX and GROUP BY - SQL
- SQL statement for a tricky 2 table query
- How to create nested selects with sql?
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Best Practice for adding columns to a Table in Oracle database
- SQL FIFO STACK using two tables
- SQL Query - Order by String (which contains number and chars)
Related Questions in PLSQL
- PLSQL Need REFCURSOR DATE + TIME
- PL SQL After Delete Trigger Not Inserting Record
- Oracle stored procedure wrapping compile error with inline comments
- How to compare multiple columns under same row in a table?
- How to find out which procedures and functions are using a table?
- How to display image in oracle form
- Oracle 11g : staging table
- 04098. "trigger '%s.%s' is invalid and failed re-validation"
- PL/SQL Check if SYSDATE is between two DATETIMES "HH24:mi"
- UTL_file: continue reading even if it encounters blank rows
- add time (char(8)) to date column
- if x not in(select y from table) in oracle
- Generate random ROWID
- Get same day of the same week last year
- Call procedure using anonymous block in pl/sql?
Related Questions in SQLPLUS
- Ignoring User Exists Error in Oracle
- In Oracle 11g how do you time weight average data hourly between two dates?
- ORA-06502 Error Only in SQLPLUS
- Connect to two DB using Oracle wallet without TNS_ADMIN path change
- Which tables do not have indexes in Oracle?
- Why is SPOOL writing my output with LINESIZE set to 32767?
- accented letters and sql plus/AIX
- How to know what SETS are ON in SQL PLUS?
- Installing rlwrap on linux - without root permission
- Hide SQL > statements in the spool file
- SQL*Plus spool only data and exclude errors
- Recover error WshShell.exec
- How to log queries taking long time
- How to specify tablespace_name in SQLPlus Oracle select
- Write to a file in PL/SQL without spools or utl_file
Related Questions in SPOOL
- Does anyone know how to read gzip file(gzip in thr spoolSourceDirectory) in Flume process?
- Hide SQL > statements in the spool file
- SQL*Plus spool only data and exclude errors
- Write to a file in PL/SQL without spools or utl_file
- Get generated spool file Swiftmailer/Symfony2
- Spooling to a file with a name containing a space and script's parameter in sqlplus?
- Remove blank line from Spool file
- SQLcl unable to set spool to file
- How to select spool's filename from table in sqlplus
- C# Debug Visualizer throug reflection: get value of property contained in complex object using Reflection
- spool with column headers in pipe delimited sqlplus
- How to send 12 000 emails via Swiftmailer in Symfony2?
- how do you spool from a stored procedure that is executed through a database link?
- linux + how to stop files creation under /var/spool/clientmqeueue
- Extra spaces appending in Spooling SQL script in UNIX
Related Questions in UTL-FILE
- Write to a file in PL/SQL without spools or utl_file
- UTL_FILE_DIR on Oracle 11g SQL client
- Oracle APEX - grabbing script output
- Invalid Directory path while executing a procedure that produces a csv file in Oracle (in windows)
- PL/SQL UTF_FILE.PUT_LINE does not add a new line
- Exporting files from Oracle BLOB to SQL FileTable - file types?
- Oracle UTL_FILE file corruption
- Write to multiple CSV files within Oracle SQL script
- Inserting data in NEWEMP table using UTL_FILE but it's able to display only one data
- What is the recommended way to encrypt in Oracle?
- PL/SQL UTL_FILE: How the loop automatically returns the next line?
- PL/SQL - UTL_FILE physical location of the file
- How to handle Chineese/Japenese characters while writing data to a .csv file using utl.file wirte plsql
- Oracle UTL_FILE issue from sql developer
- Understanding Utl_file
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
No. You will need access to
init.orato get this done the nice way through Oracle.The only other option I can think of is the use of a Java procedure to do the file writing. I couldn't find any special requirements you need to have set to use that. Read up on the subject here.