Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Spooling File to My Desktop From Back-end using shell script Post 303036503 by bmaksoud on Saturday 29th of June 2019 08:28:32 AM
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..
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
DBIx::Class::Storage::Statistics(3)			User Contributed Perl Documentation		       DBIx::Class::Storage::Statistics(3)

NAME
DBIx::Class::Storage::Statistics - SQL Statistics SYNOPSIS
DESCRIPTION
This class is called by DBIx::Class::Storage::DBI as a means of collecting statistics on its actions. Using this class alone merely prints the SQL executed, the fact that it completes and begin/end notification for transactions. To really use this class you should subclass it and create your own method for collecting the statistics as discussed in DBIx::Class::Manual::Cookbook. METHODS
new Returns a new DBIx::Class::Storage::Statistics object. debugfh Sets or retrieves the filehandle used for trace/debug output. This should be an IO::Handle compatible object (only the "print" method is used). Initially should be set to STDERR - although see information on the DBIC_TRACE environment variable. As getter it will lazily open a filehandle for you if one is not already set. print Prints the specified string to our debugging filehandle. Provided to save our methods the worry of how to display the message. silence Turn off all output if set to true. txn_begin Called when a transaction begins. txn_rollback Called when a transaction is rolled back. txn_commit Called when a transaction is committed. svp_begin Called when a savepoint is created. svp_release Called when a savepoint is released. svp_rollback Called when rolling back to a savepoint. query_start Called before a query is executed. The first argument is the SQL string being executed and subsequent arguments are the parameters used for the query. query_end Called when a query finishes executing. Has the same arguments as query_start. AUTHOR AND CONTRIBUTORS
See AUTHOR and CONTRIBUTORS in DBIx::Class LICENSE
You may distribute this code under the same terms as Perl itself. perl v5.18.2 2013-12-16 DBIx::Class::Storage::Statistics(3)
All times are GMT -4. The time now is 05:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy