Sponsored Content
Top Forums Shell Programming and Scripting Get SQL query result to file in putty Post 302905377 by edstevens on Wednesday 11th of June 2014 08:39:25 AM
Old 06-11-2014
Quote:
Originally Posted by pamu
How to Get SQL query result to file in putty?
At the risk of being pedantic, but to clarify what may be some fuzzy thinking, putty is just a terminal program - one of several that do exactly the same thing. All it does is take keystrokes from your keyboard and send them to a remote system to be processed, then receive and display whatever character strings the remote system produces in response. It has nothing in particular to do with getting SQL query result into a file.

As others are pointing out, how to get the query result into a file is a function of whatever program is actually processing your query - the client program to whatever your rdbms system is.

Also, be aware that however that file is created (like oracle's sqlplus SPOOL command) it will be created on that remote system. If you need to get the file from the remote system to your desktop where you are running putty, that is a different question.

Please clarify your exact requirement.
This User Gave Thanks to edstevens For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unloading sql query to file

In unload to "/usr/home/data.012202" I wish to use a date variable as in unload to "/usr/home/data.`date`" for the file is that possible in a query to do, or will i need to add a mv command after the query to do it. I tried backquotes, , and () on `date` but didn't seem to work Thanks... (2 Replies)
Discussion started by: Link_02
2 Replies

2. Shell Programming and Scripting

any possible to run sql result and output to file

Hi, I search all post...and no soluation about..if i would like to run a sql statement and output the result to txt file. for example, i usually run "sql" to logon the database and run select statement. Then I need to copy the output into the result.txt. Can I run the script to do this... (7 Replies)
Discussion started by: happyv
7 Replies

3. Shell Programming and Scripting

Redirecting sql select query result to txt file

Hi , I just found you while surfing for the string 'Redirecting sql select query output from within a shell script to txt file/excel file' Could you find time sending me the code for the above question? It'll be great help for me. I have a perl file that calls the sql file... (1 Reply)
Discussion started by: dolphin123
1 Replies

4. Shell Programming and Scripting

Redirecting sql select query result to txt file

Hi Yogesh, Lucky that i caught you online. Yeah i read about DBI and the WriteExcel module. But the server is not supporting these modules. It said..."Cannot locate DBI"..."Cannot locate Spreadsheet::WriteExcel" I tried creating a simple text file to get the query output, but the... (1 Reply)
Discussion started by: dolphin123
1 Replies

5. Shell Programming and Scripting

How to Format the result driven from a SQL Query

Hi All, I want to format the result driven from the query into neat format. For example pls find the below code, #! /bin/sh result=' sqlplus -s uname/passwrd@DBname select no,name,address,ph_no, passport_no,salary,designation from emp_table where salary>1000; exit EOF' ... (8 Replies)
Discussion started by: little_wonder
8 Replies

6. UNIX for Dummies Questions & Answers

How do I use SQL to query based off file data?

This is basically what I want to do: I have a file that contains single lines of IDs. I want to query the oracle database using these IDs to get a count of which ones match a certain condition. the basic idea is: cat myfile | while read id do $id in select count(PC.ptcpnt_id) from... (4 Replies)
Discussion started by: whoknows
4 Replies

7. Shell Programming and Scripting

redirecting sql query output to a file

Hi, I am executing sql files in my unix shell script. Now i want to find whether its a success or a failure record and redirect the success or failure to the respective files. meaning. success records to success.log file failure record to failure.log file. As of now i am doing like... (1 Reply)
Discussion started by: sailaja_80
1 Replies

8. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

9. UNIX for Advanced & Expert Users

Output the SQL Query result to a File

Hello Guys, This message is somewhat relates with last thread. But I need to re-write thing. I start over a little. I am stuck now and need your help. Here is my script- #! /bin/ksh export ORACLE_HOME=/opt/oracle/app/oracle/product/9.2 /opt/oracle/app/oracle/product/9.2/bin/sqlplus -s... (5 Replies)
Discussion started by: thepurple
5 Replies

10. Programming

Oracle simple SQL query result in: ORA-08103: object no longer exists

Dear community, please help with a query on Oracle. I'm using SQLPlus (but with SQLDeveloper is the same) to accamplish a sinple query like: select count(*) from ARCHIT_D_TB where (TYP_ID=22 OR TYP_ID=23) and SUB_TM like '%SEP%' and CONS=1234This is a very simple query that works perfect until... (5 Replies)
Discussion started by: Lord Spectre
5 Replies
IDENT(8)						    InterNetNews Documentation							  IDENT(8)

NAME
ident - nnrpd ident resolver SYNOPSIS
ident [-p port] [-t] DESCRIPTION
This program attempts to resolve usernames for nnrpd by using the ident protocol to query the remote host. It contacts the remote host using either IPv4 or IPv6 depending on which protocol was used for the incoming NNTP connection. OPTIONS
-p port If this option is given, attempt to contact identd on the specified remote port (which can be a numeric or symbolic specification). Non-numeric values will be looked up using getservbyname(3). The default value is the result of "getservbyname("ident")" if available, or port 113 otherwise. -t If this option is given, the identity returned will never have a domain part. That is, if the remote server returns a result containing an "@" character, ident truncates the response at the "@". This is useful to allow the default-domain parameter in reaers.conf to override the domain supplied by the remote host (particularly if the supplied domain part is an unqualified local machine name rather than a full domain name). EXAMPLE
The following readers.conf(5) fragment tells nnrpd to trust ident information for hosts on a local network, but to replace the domain returned from the ident query: auth LAN { hosts: "192.168/16" res: "ident -t" default-domain: "internal.example.com" } access LAN { users: "*@internal.example.com" newsgroups: example.* } Access is granted to the example.* groups for all users on the local network whose machines respond to ident queries. HISTORY
This documentation was written by Jeffrey M. Vinocur <jeff@litech.org>. $Id: ident.pod 8200 2008-11-30 13:31:30Z iulius $ SEE ALSO
nnrpd(8), readers.conf(5) INN 2.5.3 2009-05-21 IDENT(8)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy