Solved

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

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

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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…

744 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

11 Experts available now in Live!

Get 1:1 Help Now