Spooling File to My Desktop From Back-end using shell script


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Spooling File to My Desktop From Back-end using shell script
# 1  
Old 06-29-2019
Spooling File to My Desktop From Back-end using shell script

Hello all,
I am trying to spool a SQL query output file from back-end to desktop in a certain path but it didn't work,the query writes the output in a file in the same directory at the back-end.
note : i use the same query in sql developper and file was created in the desired path fine

code :
-------
Code:
sqlplus -s schemaname/pass@dbname <<SQL
spool C:\pathtofile\testtest.csv;
select count(*),sum(amount) from (databaseschem).(tablename)

some conditions here;

spool off;
SQL

---------------------
so can anyone figure out the reason for this ?

Last edited by rbatte1; 07-08-2019 at 07:12 AM..
# 2  
Old 06-29-2019
when sqlplus is run what user is logged into oracle? i.e., sqlplus username@password
Is that user identical and on the same physical oracle server machine as the user that works correctly?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script not spooling in the designated file.

Hi, I need to write a script that will run a simple select count(*) query and sends the result of that query to me via email. Here's what I already have. #!/bin/ksh ###################################################################### # File Name : counts.sh # Created : 2019/27/19... (1 Reply)
Discussion started by: clef
1 Replies

2. Shell Programming and Scripting

Script not spooling in result file

Hi everyone and nice to meet you :) I'm having some issues with a script I'm writing. It's probably most chaotic, I'm no ksh guru, but the idea is to extract an ID with that query, spool it into a file, and read that file making the ID a variable. This has to be done for every row extracted by... (10 Replies)
Discussion started by: Arkadia
10 Replies

3. Shell Programming and Scripting

help needed with shell script to append to the end of a specific line in a file on multiple servers

Hi Folks, I was given a task to append three IP's at the end of a specific (and unique) line within a file on multiple servers. I was not able to do that with the help of a script. All I could was: for i in server1 server2 server3 server4 do ssh $i done I know 'sed' could be used to... (5 Replies)
Discussion started by: momin
5 Replies

4. UNIX for Dummies Questions & Answers

Option in sql script to include column headers when spooling file to .csv format

Can anyone help me how to include COLUMN HEADER when spooling file to .CSV format through SQL statement. Thanks, Akbar (4 Replies)
Discussion started by: s1a2m3
4 Replies

5. UNIX for Dummies Questions & Answers

Shell scripting+connect to oracle database+spooling

Hi! Everyone I am new to the shell scripting basically.I have been asked to create a shell script that connect to a oracle database to read data from a particular schema then spool it into a csv file then email to customer. Can anybody let me know how to go about that. I have create... (14 Replies)
Discussion started by: Mr Mo
14 Replies

6. Shell Programming and Scripting

spooling through shell script

Hi, I want to spool the output from a .sql file to a .txt file through shell script. the contents of .sql are: spool /arboru02/scripts/customer_profile_def.txt select profile_id ||','|| account_no from customer_profile_def; spool off exit and shell scrip is like: #!/bin/sh... (9 Replies)
Discussion started by: ss_ss
9 Replies

7. Shell Programming and Scripting

Help on shell script : syntax error at line 62: `end of file' unexpected

Hi All, I have written a korn script (code pasted below). It is giving the error while debugging "new.sh: syntax error at line 62: `end of file' unexpected". I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies

8. Shell Programming and Scripting

Laptop/Desktop... Back up/Mirror script.

Hello all, I have a script I am trying to put together, what I am trying to do is mirror my home dir (excluding my music dir) between my desktop and laptop. My intention is to create a cron job to run two scripts, one to push the data to the laptop at the end of the day, and one to pull the data... (5 Replies)
Discussion started by: komputersman
5 Replies

9. Shell Programming and Scripting

end of file problem with shell script

My shell script was working ok with K shell. But all of sudden, it started acting crazy. it keeps saying this: syntax error at line 70 : `"' unmatched I don't even have 70 lines in my file or this : syntax error at line 69: `end of file' unexpected Can this file got... (5 Replies)
Discussion started by: whatisthis
5 Replies
Login or Register to Ask a Question