Solved

query not running

Posted on 2014-04-04
5
383 Views
Last Modified: 2014-04-06
Why this query is not working....?

SQL> SELECT * FROM
(
select
    SEGMENT_NAME,
    SEGMENT_TYPE,
    BYTES/1024/1024/1024 GB,
    TABLESPACE_NAME
from
    dba_segments
order by 3 desc
) WHERE
ROWNUM <= 10
/
 14
SQL>
0
Comment
Question by:tonydba
[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
  • 2
5 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 39978866
what's not working about it?


it runs fine for me
0
 

Author Comment

by:tonydba
ID: 39978938
The output looks like this..

 SELECT * FROM
(
select
    SEGMENT_NAME,
    SEGMENT_TYPE,
    BYTES/1024/1024/1024 GB,
    TABLESPACE_NAME
from
    dba_segments
order by 3 desc
) WHERE
ROWNUM <= 10
  2    3    4    5    6    7    8    9   10   11   12   13
SQL>
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 39978954
put a semicolon at the end of it



SELECT *
  FROM (  SELECT segment_name,
                 segment_type,
                 bytes / 1024 / 1024 / 1024 gb,
                 tablespace_name
            FROM dba_segments
        ORDER BY 3 DESC)
 WHERE ROWNUM <= 10;
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 39979029
If you copy and paste few sql statements with multiple lines, SQL Plus may display line number inappropriately. If you just type "L" in Sqlplus, you will see all statement with their corrosponding line number.
0
 

Author Closing Comment

by:tonydba
ID: 39981521
Thank you for your effort.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

734 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