10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a shell script containing multiple PSQL queries for which I want the output to be redirected to a text file.
psql -U postgres -d database -o textfile.txt << EOF
When executing the script, queries outputs are directed to textfile.txt, however... (2 Replies)
Discussion started by: nms
2. Shell Programming and Scripting
How to run multiple Queries in a ksh Script
I have a KSH script that has one SQL Query and generates and emails output of the query in HTML format. I want to change the script so that it has three SQL queries and the last query generates and emails the HTML output page of just that query.
So far... (5 Replies)
Discussion started by: JolietJake
3. Shell Programming and Scripting
I have a file queries.txt as follows :
SELECT COLUMN1 FROM SCHEMA2.TABLE1 MINUS SELECT COLUMN1 FROM SCDEMA2.TABLE2;
SELECT COLUMN2 FROM SCHEMA2.TABLE1 MINUS SELECT COLUMN2 FROM SCDEMA2.TABLE2;
SELECT COLUMN3 FROM SCHEMA2.TABLE1 MINUS SELECT COLUMN3 FROM SCDEMA2.TABLE2;
SELECT... (2 Replies)
Discussion started by: SriRamKrish
how to store the count of queries in variables inside a filein shell script
my output :
variable1=result from 1st query
variable2=result from 2nd query
. (3 Replies)
Discussion started by: sanvel
5. Shell Programming and Scripting
I have n number of SQL queries needs to executed in Shell. Result of this query need to assign in a variable. Once all the queries are executed script needs to exit.
SQL 1: Select Count(*) from TABLE GROUP BY COL1,COL2
SQL 2: Select Count(*) from TABLE GROUP BY COL1,COL2
... (2 Replies)
Discussion started by: Niranjancse
6. Shell Programming and Scripting
I have a script where I make a sqlplus connection. In the script I have multiple sql queries within that sqlplus connection. I want the result of the queries to be stored in shell variables declared earlier. I dont want to use procedures. Is there anyway else.
Thanks in advance..
Cheers (6 Replies)
Discussion started by: gonchusirsa
7. Shell Programming and Scripting
I have a requirement with,
Single column alone got splitted into multiple lines.
I require the output as
mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
8. Shell Programming and Scripting
I'm trying to build a shell script that reads a set of accounts from a file. For each account I need to perform a set of sql queries. So I have a loop with a set of sqlplus connections to retrieved my data.
Is it possible to have a single sqlplus connection before entering the loop and... (4 Replies)
Discussion started by: lsantacana
9. UNIX for Advanced & Expert Users
It's my first week using unix and shell scripting. I tried creating a script that has a function that execute SQL query. my script looks something like this:
secondTable="secondTable"... (2 Replies)
Discussion started by: edlin_r
10. Shell Programming and Scripting
i know how to run a single query using mysql embedded in a shell script as follows:
`mysql -umyuser -pmypass --host myhost database<<SQL
However, how would i be able to run several queries within the same connection?
The reason for this is i am creating... (3 Replies)
Discussion started by: muay_tb