Solved

View script output from sqlplus

Posted on 2009-04-01
2
324 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now