10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
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
Query1;
Query2;
Query ....;
EOF
When executing the script, queries outputs are directed to textfile.txt, however... (2 Replies)
Discussion started by: nms
2 Replies
2. Shell Programming and Scripting
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
3. Shell Programming and Scripting
Hi All,
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
2 Replies
4. Shell Programming and Scripting
currently I have process from a raw file to this stage
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_VOID" ADD CONSTRAINT "PK_TC_TXN_VOID" PRIMARY KEY ("TC_TXN_IID")
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_AMT" ADD CONSTRAINT "PK_TC_TXN_AMT" PRIMARY KEY ("TC_TXN_AMT_IID")
ALTER TABLE... (10 Replies)
Discussion started by: jediwannabe
10 Replies
5. Solaris
Hi, I put a for loop in a script to eject backup tapes from the robot. The command echo' output goes to the log file without problem, but command vmchange's output does not go to the log file although it's working fine. It still displays on the screen. I've tried '2>&1 1>$log', but nothing changed.... (5 Replies)
Discussion started by: aixlover
5 Replies
6. Shell Programming and Scripting
Here is the sample of my file address.txt
Address 1
1234 Drive way
New Orleans, LA
Zipcode :- 12345
Address 2
4567 Spring way
Chicago, IL
Zipcode :- 67890
I would like to grep for an Address title (Ex :- Address 2) , then get its zipcode and echo both in a single line. Ex :- ... (3 Replies)
Discussion started by: leo.maveriick
3 Replies
7. Shell Programming and Scripting
Hi,
I need your help in sedning sql queries output to different excel sheets.
My requirement is like this:
Query1: Select name from table1 where status = 'Complete'
Query2: Select name from table1 where status = 'Failed'
Query3: Select name from table1 where status = 'Ignored'
... (4 Replies)
Discussion started by: parvathi_rd
4 Replies
8. Shell Programming and Scripting
Hi,
I new to Unix and scripting. Following is my requirement. Can someone tell me whether its possible or not. Also please let me know how to proceed further if this is possible.
List of queries are stored in a file. For example, I have to run a query like this:
Select * from &XYZ where... (0 Replies)
Discussion started by: simhasuri
0 Replies
9. Shell Programming and Scripting
Hi guys,
I Have written a script,In that it will call another file which contains the sql quaries.
while wxecuting that I am getting the below exception
01/16|06:28:06:16800: Operating System Error|Failed to open output file
Can anybody help me about this,,Its urgent (0 Replies)
Discussion started by: Anji
0 Replies
10. Shell Programming and Scripting
hi,
why the following is giving entire /etc/passwd file as output
even when it does not contain ^ or $ .
grep ' ' /etc/passwd
whereas the following is not giving any output
grep ' ^$ ' /etc/passwd (3 Replies)
Discussion started by: useless79
3 Replies