473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

with clause for subquery factoring

Hi,

The following does not return result:

with free_space_by_tablespace as
( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name
select * from free_space_by_tablespace ;

BUT this does:
select * from (with free_space_by_tablespace as
( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name
select * from free_space_by_tablespace
)
What is wrong with my query?

This occurs in Sql/plus and SQL navigator v4.4.5. In MS ACCESS pass
through query, I also got the no records returned warning.

Is it due to the version problem on my client software? My Oracle
server is 9.2 and above

Thanks for any points on this.

Jul 19 '05 #1
2 9055
we**********@yahoo.com wrote:
Hi,

The following does not return result:

with free_space_by_tablespace as
( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name
select * from free_space_by_tablespace ;

BUT this does:
select * from (with free_space_by_tablespace as
( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name
select * from free_space_by_tablespace
)
What is wrong with my query?

This occurs in Sql/plus and SQL navigator v4.4.5. In MS ACCESS pass
through query, I also got the no records returned warning.

Is it due to the version problem on my client software? My Oracle
server is 9.2 and above

Thanks for any points on this.


Missing parenthesis from first version?

or******@binc04.tree> with free_space_by_tablespace as
2 ( select sum(bytes)/1024 Kbytes_free,
3 max(bytes)/1024 largest,
4 tablespace_name
5 from sys.dba_free_space
6 group by tablespace_name
7 select * from free_space_by_tablespace ;
select * from free_space_by_tablespace
*
ERROR at line 7:
ORA-00907: missing right parenthesis

or******@binc04.tree> list
1 with free_space_by_tablespace as
2 ( select sum(bytes)/1024 Kbytes_free,
3 max(bytes)/1024 largest,
4 tablespace_name
5 from sys.dba_free_space
6 group by tablespace_name)
7* select * from free_space_by_tablespace
or******@binc04.tree> /

KBYTES_FREE LARGEST TABLESPACE_NAME
----------- ---------- ------------------------------
51136 51136 LOBS
768 768 MONITOR
16320 10944 SYSAUX
96512 96192 SYSTEM
153408 51136 TESTDB_A
142912 98240 UNDO01
51136 51136 USER01
34752 34752 XDB

8 rows selected.

-Mark Bole

Jul 19 '05 #2
Thanks Mark.

After I upgrade my oracle client from 8.1.17 to 9.2 then it works.
Hope this is useful for other person

Mark Bole wrote:
we**********@yahoo.com wrote:
Hi,

The following does not return result:

with free_space_by_tablespace as
( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name
select * from free_space_by_tablespace ;

BUT this does:
select * from (with free_space_by_tablespace as
( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name
select * from free_space_by_tablespace
)
What is wrong with my query?

This occurs in Sql/plus and SQL navigator v4.4.5. In MS ACCESS pass
through query, I also got the no records returned warning.

Is it due to the version problem on my client software? My Oracle
server is 9.2 and above

Thanks for any points on this.


Missing parenthesis from first version?

or******@binc04.tree> with free_space_by_tablespace as
2 ( select sum(bytes)/1024 Kbytes_free,
3 max(bytes)/1024 largest,
4 tablespace_name
5 from sys.dba_free_space
6 group by tablespace_name
7 select * from free_space_by_tablespace ;
select * from free_space_by_tablespace
*
ERROR at line 7:
ORA-00907: missing right parenthesis

or******@binc04.tree> list
1 with free_space_by_tablespace as
2 ( select sum(bytes)/1024 Kbytes_free,
3 max(bytes)/1024 largest,
4 tablespace_name
5 from sys.dba_free_space
6 group by tablespace_name)
7* select * from free_space_by_tablespace
or******@binc04.tree> /

KBYTES_FREE LARGEST TABLESPACE_NAME
----------- ---------- ------------------------------
51136 51136 LOBS
768 768 MONITOR
16320 10944 SYSAUX
96512 96192 SYSTEM
153408 51136 TESTDB_A
142912 98240 UNDO01
51136 51136 USER01
34752 34752 XDB

8 rows selected.

-Mark Bole


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bob Stearns | last post by:
When I run the following query with the two sections commented out, the response time is between 1 an 2 seconds; with the first indicated section enabled, the response goes up to 15 seconds even...
1
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
18
by: ChadDiesel | last post by:
I appreciate the help on this group. I know I've posted a lot here the last couple of weeks, but I was thrown into a database project at my work with very little Access experience. No other...
21
by: mollyf | last post by:
I'm creating a query, which I want to use in code in my VB.NET app. This query produces the correct results when executed in Access: SELECT tblEncounters.EncounterBeginDT, Query11.RID,...
4
by: Sebastian Böck | last post by:
Hello all, i have a view defined as a simple select of a table. This table is inherited by a couple of others. All entries belong to the child-tables. I also have an unconditional update rule...
5
by: No bother | last post by:
I am using 5.0.26-NT on Windows 2000. I have need to use a reference in the outer from clause in a subquery in the select clause. Consider the following example: Select (select b.baitID from...
5
by: Anne | last post by:
Hello! Here is the statement in question: --STATEMENT A SELECT * FROM dbo.myTable WHERE colX in (SELECT colX FROM dbo.sourceTable) The problem with Statement A is that 'colX' does not exist...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
2
by: web_poster03 | last post by:
Hi, The following does not return result: with free_space_by_tablespace as ( select sum(bytes)/1024 Kbytes_free, max(bytes)/1024 largest, tablespace_name from sys.dba_free_space group by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.