?
Solved

View script output from sqlplus

Posted on 2009-04-01
2
Medium Priority
?
340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

752 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