Solved

View script output from sqlplus

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

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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…

770 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