Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I also believe that we all can contribute to each other's growth by sharing knowlege and experiences. I would love to take my skills and help people around the world solve problems..."

Geography

Where in the world do Tek-Tips members come from?

Need help with spolling to a file (Oracle)

tiver43809 (IS/IT--Management)
4 Apr 08 8:15
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
johnherman (MIS)
4 Apr 08 8:39
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

johnherman (MIS)
4 Apr 08 8:43
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

hoinz (MIS)
4 Apr 08 8:53
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
 
tiver43809 (IS/IT--Management)
4 Apr 08 9:36
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
 

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!

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