Sponsored Content
Top Forums Shell Programming and Scripting [Solved] How to display only output of DBMS_OUTPUT.PUT_LINE , rest should be neglected Post 302644645 by sujit_kashyap on Tuesday 22nd of May 2012 08:36:17 AM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Swatch::Threshold(3pm)					User Contributed Perl Documentation				    Swatch::Threshold(3pm)

NAME
Swatch::Threshold - Perl extension for thresholding in swatch(1) SYNOPSIS
use Swatch::Threshold; &Swatch::threshold( SWID => <int>, TYPE => <limit|threshold|both>, TRACK_BY => <key>, # like an IP addr COUNT => <int>, SECONDS => <int> ); SWATCH SYNTAX
threshold track_by=<key>, type=<limit|threshold|both>, count=<int>, seconds=<int> DESCRIPTION
SWID is swatch's internal ID number for the watchfor block TYPE can be limit, threshold, or both Limit - Alert on the 1st COUNT events during the time interval, then ignore events for the rest of the time interval. Threshold - Alert every COUNT times we see this event during the time interval. Both Alert once per time interval after seeing COUNT occurrences of the event, then ignore any additional events during the time interval. SECONDS is the time interval AUTHOR
E. Todd Atkins, todd.atkins@stanfordalumni.org SEE ALSO
perl(1), swatch(1). perl v5.10.0 2006-07-21 Swatch::Threshold(3pm)
All times are GMT -4. The time now is 10:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy