×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need help with spolling to a file (Oracle)

Need help with spolling to a file (Oracle)

Need help with spolling to a file (Oracle)

(OP)
I am trying to send the results of a query to a file.
My problem is one of the fields is long which means it oould have up to 2 gig worth of data. I tried this below but I am still not sure i am getting everything out. What I would like to do is run a query that will show the number of characters in each field of my table. That way I might be ablt to use longchunk. Any ideas?
Thank You,
In over his head Terry

SET PAGESIZE 10000
SET LINESIZE 130
SET LONG 5000
select tsxre2,tsddat,tscomm,tmrmks,tsxref,tsidat,tspoci,tsbldg,tsroom,tsname,tsntel
from tsr,tsrrmk
where tsnumb=tmnumb and tscdat is null
order by tsxre2

RE: Need help with spolling to a file (Oracle)

SET PAGESIZE 10000
SET LINESIZE 130
SET LONG 5000
SPOOL <filename and path>
select tsxre2,tsddat,tscomm,tmrmks,tsxref,tsidat,tspoci,tsbldg,tsroom,tsname,tsntel
from tsr,tsrrmk
where tsnumb=tmnumb and tscdat is null
order by tsxre2
SPOOL OFF

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright

RE: Need help with spolling to a file (Oracle)

To create a flatfile:
SET SERVEROUTPUT ON SIZE 1000000 (or larger if needed)
SET NEWPAGE 0
SET SPACE 0
SET PAGESIZE 0 (one continuous page)
SET LINESIZE ? (not sure if 0 works)
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SPOOL <filename and path>
query
SPOOL OFF
 

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright

RE: Need help with spolling to a file (Oracle)

A few ideas about it:

1) You might get more help, if you asked in an Oracle specific forum. There are quite a few here at Tek-Tips.

2) You might get more useful answers, if you provided more information about your problem, e.g. Oracle version and data type of your columns.

3) That being said, I am supposing the Oracle data type of the columns in question might be long.
In this case you will not get the part exceeding 5000 characters, because of your 'SET LONG 5000'. (You probably already knew!)
And finding the maximal length may be tricky; have a look at
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:120212348063

hope this helps
 

RE: Need help with spolling to a file (Oracle)

(OP)
THANKS
I was able to use the second part here at our test site. We do not have anywhere the notes in that one field so I am not sure what it look like when I run it there. I am trying the function create now.
Thanks Again
Terry
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close