• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

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