Collections:
Save Query Output to a Local File in Oracle
How To Save Query Output to a Local File in Oracle?
✍: FYIcenter.com
Normally, when you run a SELECT statement in SQL*Plus, the output will be displayed on your screen. If you want the output to be saved to local file, you can use the "SPOOL fileName" command to specify a local file and start the spooling feature. When you are done with your SELECT statement, you need to close the spool file with the "SPOOL OFF" command. The following tutorial exercise gives you a good example:
SQL> connect HR/retneciyf SQL> SET HEADING OFF SQL> SET FEEDBACK OFF SQL> SET LINESIZE 1000 SQL> SPOOL \temp\employees.lst SQL> SELECT * FROM EMPLOYEES; ...... SQL> SPOOL OFF
You should get all records in employees.lst with fixed length fields.
2020-07-15, 928👍, 0💬
Popular Posts:
Can SELECT Statements Be Used on Views in SQL Server? Select (query) statements can be used on views...
What are DDL (Data Definition Language) statements for tables in SQL Server? DDL (Data Definition La...
How To Create a Table in a Specific Tablespace in Oracle? After you have created a new tablespace, y...
How do you know if SQL Server is running on your local system in SQL Server? After installing SQL Se...
How To Download Oracle Database 10g XE in Oracle? If you want to download a copy of Oracle Database ...