View script output from sqlplus

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
obrienjAsked:
Who is Participating?
 
MilleniumaireCommented:
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
 
MilleniumaireCommented:
Try this:

set long 99999999 feedback off pagesize 0

select text
from dba_views
where view_name = 'MY_VIEW';
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.