Solved

problem when I extracted the last 4 lines then the first to have my result.

Posted on 2011-03-17
3
360 Views
Last Modified: 2012-05-11
Hello,

In the script shell, I have a problem when I extracted the last 4 lines then the first to have my result. I use  (tail 4 ¦ Head 1)
BU=`expr substr "${S_CODUG}" 4 3`
echo BU=${BU}
 
Date01="`date +'%Y-%m-%d_%H-%M'`"
# P***A et P***C
requete3=`sqlplus ${UxDbaseUser}@${UxDbaseSid} << EOF | tail -4 | head -1
set head off feedback off  ;
select sum(gross_extended_amt)
from ps_sg_bi_cess_tmp

In Oracle9, the end of a session SQL sends back the message following on 3 lines
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and oracle Data Mining opted
JServer Release 9.2.0.8.0 - Production

In Oracle11, the end of a session SQL sends back the message following on 2 lines only Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production Disconnected from With the Partitioning, OLAP, Data Mining and Real Application Testing opted

How can I resolve this problem?

Thanks

Regards

Bibi
0
Comment
Question by:bibi92
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
MrNed earned 500 total points
ID: 35161500
I think you want to use the -s (silent) flag when calling sqlplus:

requete3=`sqlplus ${UxDbaseUser}@${UxDbaseSid} << EOF | tail -4 | head -1

This suppressed the banner completely.
0
 

Author Closing Comment

by:bibi92
ID: 35163969
Thanks a lot
0
 
LVL 7

Expert Comment

by:MrNed
ID: 35164007
Oops sorry, just realised I didn't put the -s in the command line when I copy/pasted, but you get the idea :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle Pivot 2 43
oracle report printing 2 pages in one page 2 57
null value 15 92
Need help with fine tuning the windows batch script to change password 9 16
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now