[Solved] How to display only output of DBMS_OUTPUT.PUT_LINE , rest should be neglected


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] How to display only output of DBMS_OUTPUT.PUT_LINE , rest should be neglected
# 1  
Old 05-22-2012
[Solved] How to display only output of DBMS_OUTPUT.PUT_LINE , rest should be neglected

Hi All,

I Have written a script through that i am calling sql file

Sqlfile.sql

Code:
set time on
set timing on
set echo on
set head off
set scan on
set feedback on
set serveroutput on
set linesize 1000
DECLARE
v_acc_no NUMBER(10);
v_product_no NUMBER(10);
BEGIN
DBMS_OUTPUT.ENABLE(10000000);
select COUNT(*) INTO v_acc_no from &1;
SELECT COUNT(*) INTO v_product_no from &2;
DBMS_OUTPUT.PUT_LINE(v_acc_no||','||v_product_no);
END;

Its giving me following output


Code:
old 6: select COUNT(*) INTO v_acc_no from &1; 
new 6: select COUNT(*) INTO v_acc_no from Account; 
old 7: SELECT COUNT(*) INTO v_product_no from &2;
new 7: SELECT COUNT(*) INTO v_product_no from product_history; 
21652,679 
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01

But i want to keep only the output this ie 21652,679 , rest i want to neglect ,
Is it possible to do it in sql only by setting some feature
ie set something off

Thanks

Last edited by radoulov; 05-22-2012 at 09:46 AM.. Reason: Marked as solved.
# 2  
Old 05-22-2012
After the post editing the colors disappeared,
you could start by disabling verify:

Code:
set verify off

This User Gave Thanks to radoulov For This Post:
# 3  
Old 05-22-2012
Hi all,

I find the solution,

Its set verify off

Sorry for the Thread.


---------- Post updated at 07:48 AM ---------- Previous update was at 07:45 AM ----------

can i also elimnate this output, By setting some feature off/on

PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
# 4  
Old 05-22-2012
Yes:
Code:
set feed off timing off

Notice also that you've enabled them explicitly in your script ...
This User Gave Thanks to radoulov For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

DBMS_OUTPUT.PUT_LINE doesn't print values in shell script

Hello, I'm trying to print the value of my cursor in the dbms_output.put_line in shell script, but it only shows "PL/SQL procedure successfully completed." nothing else. I have set serveroutput on, Below is my script : Any advise would be really helpful. sqlplus -s $ORACLE_LOGON <<EOF >>... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Custom actions in Thunar doesn't display at all.

I have came across a few websites stating some custom actions for Thunar - crunchbang ubuntu I tried inputting the stated commands to Thunar, but it doesn't display at all in mine. I tried "gksu thunar %f" ( Opens current folder with root permissions.) , but when I right click in a... (0 Replies)
Discussion started by: Hijanoqu
0 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Grep multiple files and display first match

I have a need to grep a large number of files, but only display the first result from each file. I have tried to use grep, but am not limited to it. I can use perl and awk as well. Please help! (9 Replies)
Discussion started by: dbiggied
9 Replies

4. HP-UX

[Solved] Weird 'ls -l' output

Hello folks, I've found an HP-UX server with a rare 'ls -l' output. Please see the attached file. Anybody knows how can I change the output to not have this extra tabulations? Thanks in advance! (10 Replies)
Discussion started by: carpannav
10 Replies

5. Shell Programming and Scripting

[Solved] Output on one line

A simple question, but i am finding it diffcult to find the answer. Can you please tell me how i can get the output of two line on one. I am aware i need to enter \ something, but no sure which charcter, can you advice. CODE for i in `cat LDN_HOSTS_190813 | grep -i LDN | awk '{print... (7 Replies)
Discussion started by: Junes
7 Replies

6. HP-UX

[Solved] Need help in date display

Hi, I have one hp-ux sytem date display problem when viewed remotely hostA 21: date Fri Jul 5 11:18:51 SST 2013 hostA 22: remsh hostB -l username -n date 2013年07月05日 11時32分27秒 But on actual system it display correctly:confused: hostB 21: date Fri Jul 5 11:40:33 SST 2013 (4 Replies)
Discussion started by: jorendain
4 Replies

7. Shell Programming and Scripting

Cant see rest of the output of the file using awk

I am trying to parse through set of data from large txt file and only intersted in output below . i am using below awk command to get the output but it only shows first line , i need to see the rest of the output under hardware inventory. see below ]$ awk '{ if ( $0 ~ "^Hardware inventory" )... (10 Replies)
Discussion started by: Jared
10 Replies

8. Programming

How to Format database output (DBMS_OUTPUT.PUT_LINE) in unix?

Dear All, As I'm new here, please forgive me if any rule violation occurred. I have a script like this: #! /bin/ksh # Author : Saptarshi # Date : 18-Mar-2011 # Version : 1.0 Return_op=`sqlplus -s <<ENDOFSQL db_user/db_pass@db_nm WHENEVER SQLERROR EXIT 1 set ... (1 Reply)
Discussion started by: saps19
1 Replies

9. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

10. Shell Programming and Scripting

sqlplus and dbms_output.put_line in shell script

Hi, I have created a pl/sql block utilises dbms_output.put_line. This script works fine when I call from sqlplus ie sqlplus @./scriptname but when I embed it within my shell script I get no output to screen so I end up with an empty spool file. I know it's executing successfully when called from... (6 Replies)
Discussion started by: stuck1
6 Replies
Login or Register to Ask a Question