SunQuest
           Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old January 24th, 2005, 04:32 AM
Paul Izzo Paul Izzo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 14 Paul Izzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 0
Question How to Spool the Output of a Cursor to a Flat File?

I have a SQL script that contains a cursor in it. I'm having trouble with spooling the output of the cursor. Does anyone know of a way to do this?

Reply With Quote
  #2  
Old January 24th, 2005, 09:35 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
I have too little information about what you're trying to do to give decent answer but here is one way using DBMS_OUTPUT:
Code:
set serverout on size 1000000
set pages 55
spool t.lis
DECLARE
      CURSOR whatever is 
           SELECT a_column_name fld 
           FROM mytable;
BEGIN
      DBMS_OUTPUT.enable(1000000);
      FOR X in whatever
      LOOP
            DBMS_OUTPUT.put_line('fld=' || x.fld);
      END LOOP;
END;
/

spool off

Reply With Quote
  #3  
Old January 25th, 2005, 01:14 AM
Paul Izzo Paul Izzo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 14 Paul Izzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 0
Thanks Jim,

It worked out for me.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > How to Spool the Output of a Cursor to a Flat File?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway