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 answers
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
- SQL schema for a fill-in-the-blank exercise
- Hibernate: JOIN inheritance question - why the need for two left joins
- What's supposed to be the problem in this query?
- Compare fields in two tables
- How to change woocomerce or full wordpress currency with value from USD to AUD
- Dynamic query creation with Array like implementation
- SQL query to get student enrolled in this month in a course - Moodle
- SQL LAG() function returning 0 for every row despite available previous rows
- Convert C# DateTime.Ticks to Bigquery DateTime Format
- Use row values from another table to select them as columns and establish relations between them (pivot table)
- SQL: Generate combination table based on source and destination column from same table
- how to use system's environnement variables in sql script
- PHP fetchAll on JOIN
- Multitable joining in Sql
- How to display name starting from 'z' by using BETWEEN cmd only?
Related Questions in PLSQL
- How to send message to syslog agent in plsql
- In PLSQL, How to fetch "User Tables" but not limited to Owner wise only, that have been created under different Schemas of different Users
- How to add the decimal point based on the condition in oracle?
- I am writing the sql query to get the latest supervisor and their job
- How to pass a array object to an oracle stored procedure?
- Difference between an "IS" or "AS" function/procedure declaration PL/SQL
- Best way to create a conditional SQL query? CASE, DECODE, or IF/THEN?
- Can anyone please post working code to send email using sendgrid on Azure databse using PLSQL procedure
- Retrieve record specific date and time in Oracle SQL
- Need to use join result into second cursor in PL/SQL
- ORACLE: Build 'INSERT INTO' statements from 'SELECT *' results
- ORACLE: Build 'INSERT INTO' statements from SELECT * results
- Error in Syntax - Oracle APEX - apex_authorization.is_authorized function
- How to convert CLOB to varchar , and separate them by comma
- Please, my Oracle EBS query when creating a custom report still contains duplicate data,
Related Questions in SQLPLUS
- sqlplus myusername/mypassword@ORCL not working with Oracle on Docker
- Editor in SQLPLUS gives error when changing default editor
- sqlplus pointing to libclntsh.so.21.1 which does not exists in $ORACLE_HOME/lib
- SP2-0734:Unknown command beginning "CONSTRAINT..."
- I am not able to understand why I am getting this type of an output in SQLPlus. If someone could help me out with this it would be great
- How to add new line in sqlplus within a bash script?
- can't login via sqlplus command but manual login works
- Error appearing while creating a table in my class in oracle 21c
- Does PostgreSQL have a feature like 'Ampersand Substitution' in SQL*Plus?
- Oracle - Load local/client file to blob column
- Merge statement into table creates duplicates?
- Running .sql script file from sqlplus succeeds, but passing the sql string as standard input of sqlplus fails with SQL> SP2-0734 in powershell
- Check oracle db mode as another user faling
- ERROR: ORA-12154: TNS:could not resolve the connect identifier specified (First time installation)
- Remove initial and trailing blank line in SQL *Plus SPOOL (SET MARKUP CSV)
Related Questions in SPOOL
- How to generate an output file directly into my local machine when running a spool script using Oracle sqldeveloper?
- space in the export file Oracle SQL
- Having Issue spooling data to CSV file
- I want to export oracle table into an Excel sheet side by side
- Multiple queries saves on desktop - Spool issue - SQL Developer
- sqlplus spool to csv will contain multiple header rows
- How to Create folder from PLSQL command window using sql during spool
- Oracle sqlplus - Error: not spooling currently
- Oracle SQL predefined variable _CONNECT_IDENTIFIER not working with Spool in Toad
- Column width in spool file is 4 times of expected width
- VARCHAR2 column formatting in spool file
- SQL Developer spool command outputs commands as well as results
- Syntax SQL Variable for spool path
- How to round time to nearest hour in spoon pentaho
- Spool - Microsoft Print to PDF, Microsoft XPS Document Writer - Error in converting SPL file to Images
Related Questions in UTL-FILE
- PL/SQL exporting csv file
- Write to multiple CSV files within Oracle SQL script
- Oracle UTL_FILE file corruption
- Oracle UTL_FILE. how to create OS directory
- Got ORA-29280 with UTL_FILE
- Cursor and CSV using utl_file package
- Oracle sql : read/write to CSV files using sql
- Oracle utl_file throwing error when the input buffer size exceeds more than 1000 character
- Utl_File not generating file in the server path
- HPL/SQL UTL_FILE.PUT_LINE Puts NULL Character Between Each Character
- PLSQL procedure to write to File XML Data - some data sometimes gets missed
- How do I convert the contents of multiple tables to XML in SQL*Plus?
- Downloading file from S3 bucket - AWS Oracle RDS
- Number of rows inserted/updated in utl_file
- HOW TO ADD HEADER AND FOOTER AT THE OF THE CODE TO GET THE REQUIRED O/P
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?
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)
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.