?
Solved

Suppressing all terminal output from Oracle when running an SQL query from a ksh script

Posted on 2005-03-22
4
Medium Priority
?
1,857 Views
Last Modified: 2008-08-05

I want to suppress all terminal output generated by Oracle / SQL when I run a query that resides in a ksh script.  This is because this is a crontab run and everything is spooled to files anyway.

Here is a snippet from my ksh script....

sqlplus -s .......
set pagesize 0 feedback off verify off termout off showmode off heading off echo off
insert into
...

When I run this interactively, I still see the Oracle version and other message on the terminal.  What settings should I be using ?
0
Comment
Question by:jmohsin
[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
4 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 13604460

The options you posted (sqlplus -s and set ....) do the trick!
You should get no output except if you do have a select ... from ... that generates a result set.
0
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 1800 total points
ID: 13604485
Example:

$ cat m2
#!/bin/ksh
sqlplus -s scott/tiger <<EOF
set pagesize 0 feedback off verify off termout off showmode off heading off echo
 off
select empno, ename, job from emp where job='CLERK';
exit
EOF

$ m2
      7369 SMITH      CLERK
      7876 ADAMS      CLERK
      7900 JAMES      CLERK
      7934 MILLER     CLERK
$

See...no messages.
0
 
LVL 6

Assisted Solution

by:makhan
makhan earned 200 total points
ID: 13608525
when u submit the program to cron just use the redirection to /dev/null

like this for ex.

0 8-22/1 * * *  /bin/dial ; kill -HUP `cat /var/run/crond.pid` >> /dev/null

This will nither report the cron job exectution in your mail nor any output from that.

Regards!

0
 

Expert Comment

by:vinit_kumar_chawla
ID: 22159105
I do not want, even the select results os select query. Can you please suggest me what should I do?
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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 Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

765 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