• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 480
  • Last Modified:

Export SQL Results Telnet

Hi Experts,

We are running a SQL statement inside a telnet session and would like to export the results to a text file.  Here is a our SQL statement:

sql 'select * from data_3072'

Any insight is appreciated.
0
irishski
Asked:
irishski
  • 4
  • 4
1 Solution
 
Bill PrewCommented:
What is the "SQL" command that you are running?

Have you tried redirecting the output with something like this?

sql 'select * from data_3072'>results.txt

~bp
0
 
irishskiAuthor Commented:
Great... that worked... however it isn't formatted too well... do you have any tricks to format the output?
0
 
Bill PrewCommented:
What is the issue with the output, is it because you have a large number of columns in that table and so lines are wrapping around to multiple lines?

Is SQL a synonym for sqlplus, or something else?  I ask this because there are some sqlplus commands that can change line lengths etc, but don't want to suggest those if you are not running sqlplus.

If SQL is something else, that utility is that?

~bp
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
irishskiAuthor Commented:
attached is what the output is looking like.  We have a telnet session to a unix box that has MYSQL on it.  Thoughts?
results.txt
0
 
Bill PrewCommented:
That actually doesn't look very bad, it has one row per line and the columns are aligned.  What are you looking for specifically.

Also, you placed this in the PL/SQL zone, should it really be in the MYSQL zone?

~bp
0
 
irishskiAuthor Commented:
Yes... probably should have been in MYSQL... we have both an Oracle and MYSQL setup.  We are looking to have each record on it's own line in the output.

Thanks for the help.
0
 
Bill PrewCommented:
The output you sent me did have one row per line of the file, perhaps you were displaying it in a manner that caused wrapping, but the file itself looked good when I opened it in an editor.

~bp
0
 
irishskiAuthor Commented:
Thanks for the help!  
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.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now