Solved

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

Posted on 2011-03-17
3
361 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

785 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