Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-17
3
Medium Priority
?
367 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
MrNed earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

610 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