10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am trying to write SQL query output into a .csv file. But in the output columns are displaying in different lines instead of coming in one line.
Main Code shell script:
this is my code:
#!/bin/bash
file="db_detail.txt"
. $file
rm /batch/corpplan/bin/dan.csv... (6 Replies)
Discussion started by: sandeepgoli53
6 Replies
2. Solaris
Hi
I am trying to run sql query from solaris in csh script and send the output to email. Below is my sql query
select p.spid,se.program seprogram, se.machine, se.username, sq.sql_text,sq.retrows from v$process p
inner join v$session se on p.addr = se.paddr
inner join
( select... (2 Replies)
Discussion started by: tharmendran
2 Replies
3. Shell Programming and Scripting
Hi,
I never did this before... what I want to do is execute a SQL query from a unix script and redirect sql query's output to a flat file (comma separated one) without the header info (no column names). I would also want not to print the query's output to the screen.
snapshot of my script:... (13 Replies)
Discussion started by: juzz4fun
13 Replies
4. Shell Programming and Scripting
In my korn shell - I have a sql with say 6 columns whose output i am redirecting to a file and attaching this file while sending a mail. While all this happens correctly, i face issues in the format of this file.
my intended output is
Column_1 Column_2 Column_3 Column_4 ... (7 Replies)
Discussion started by: qwertyu
7 Replies
5. Shell Programming and Scripting
Hi
I want ot save SQL query result in one txt file. for that i have written one code line
sqlplus -s $dbstring @/usr/local/bin/sched/nightly_Cronjob/exec_123.sql >> /usr/local/bin/sched/nightly_Cronjob/result.txt
but it is not working .
database : Oracle
so please advice me how can i... (7 Replies)
Discussion started by: Himanshu_soni
7 Replies
6. UNIX for Advanced & Expert Users
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
Hi all
I would like to open a SQL session from within a shell script and then redirect the output of the SQL command to a file.
e.g.
#!/bin/bash
sqlplus "/ as sysdba" <<EOF
@$HOME/recovery_space.sql
EOF
I want to redirect the output of the SQL command to a temp file, because... (2 Replies)
Discussion started by: soliberus
2 Replies