?
Solved

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

Posted on 2011-03-17
3
Medium Priority
?
366 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
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.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Suggested Courses

771 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