The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
script for nested rlogin and telnet mcburke38 Shell Programming and Scripting 5 03-06-2008 03:05 PM
sed in awk ? or nested awk ? varungupta UNIX for Advanced & Expert Users 11 02-08-2008 07:34 AM
Nested Arrays guysporty Shell Programming and Scripting 5 04-13-2005 04:44 AM
nested read TioTony Shell Programming and Scripting 2 03-05-2004 12:11 PM
Nested calls omran Shell Programming and Scripting 6 08-16-2002 01:18 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #15  
Old 09-20-2005
Registered User
 

Join Date: Aug 2005
Posts: 43
but why I added that line and it still doesnt work.
Reply With Quote
Forum Sponsor
  #16  
Old 09-21-2005
Registered User
 

Join Date: Jan 2005
Posts: 682
That is a good question but, as you can see, I added my query to your PL/SQL block and the results changed from no output to output.

I can think of two possibilities:
1. You mistyped it. The text must be as follows: SET SERVEROUTPUT ON. Note that there are no spaces between SERVER and OUTPUT.

2. Your query results in no rows. Try my code block as a test to prove it to yourself that it works. The only requirement is that you have an EXPLAIN PLAN table defined. If you do not, change PLAN_TABLE to something you do have in your schema.

Last edited by tmarikle; 09-21-2005 at 09:08 AM.
Reply With Quote
  #17  
Old 09-21-2005
Registered User
 

Join Date: Aug 2005
Posts: 43
I had thought probably I mistyped something,however, I checked it again and again, the answer is no.

is it possible to cause this problem because of the system?

one more difference is i got count(*) in the query and u havent.

Last edited by YoYo; 09-21-2005 at 12:50 PM.
Reply With Quote
  #18  
Old 09-21-2005
Registered User
 

Join Date: Jan 2005
Posts: 682
No, it isn't a system problem. I would guess that your query returns no rows at this point.

Try my example above and remember to change "REM #### LINE COMMENTED OUT #### set serveroutput on" to "set serveroutput on" and change "un/pw" to something meaningful on to your database.
Reply With Quote
  #19  
Old 09-21-2005
Registered User
 

Join Date: Jan 2005
Posts: 682
You must have edited your message after I read it. The COUNT(*) isn't going to change anything either but now you have given me a thought of how we can test your query.

Place "SELECT COUNT(*), COUNT(*), repeat for total number of columns you are fetching FROM (" before your your first SELECT keyword and place ")" at your SQL's semi-colon ;.

This will prove how many rows your query is return.

Example with my query:
Code:
    cursor cs is
        select count(*), count(*) from (
         select t.table_name, c.column_name
         from
           (select table_name
                  ,column_name
            from   all_tab_columns) c
          ,(select table_name
            from   all_tables) t
        where t.table_name = c.table_name
        and   t.table_name = 'PLAN_TABLE'
        );
This will always return one row; mine is "112,112". If your query returns no rows, you'll get "0,0" always.

Last edited by tmarikle; 09-21-2005 at 01:03 PM.
Reply With Quote
  #20  
Old 09-21-2005
Registered User
 

Join Date: Aug 2005
Posts: 43
many thanks for your help. i have sorted out. silly mistake.
cheers.
Reply With Quote
  #21  
Old 09-21-2005
Registered User
 

Join Date: May 2005
Posts: 49
Hi,
When I tried the example above , evrything is working fine.. but one extra blank line is getting printed... how can I avoid that..

Shihab
Reply With Quote
Google The UNIX and Linux Forums
Reply

« empty line | telnet »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0