Solved

View script output from sqlplus

Posted on 2009-04-01
2
331 Views
Last Modified: 2013-12-07
Hey,
I want to get the script of a particular view outputed to an .sql or .txt file from an oracle database.
The only utility available is sqlplus via command prompt.  Could someone quickly explain how I go about doing this?
Thanks,
J
0
Comment
Question by:obrienj
  • 2
2 Comments
 
LVL 16

Expert Comment

by:Milleniumaire
ID: 24040993
Try this:

set long 99999999 feedback off pagesize 0

select text
from dba_views
where view_name = 'MY_VIEW';
0
 
LVL 16

Accepted Solution

by:
Milleniumaire earned 500 total points
ID: 24041007
You can use spool to get the output into a file:

spool myfile.txt

set long 99999999 feedback off pagesize 0

select text
from dba_views
where view_name = 'MY_VIEW';

spool off
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question