Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old March 4th, 2004, 08:05 AM
webfrancy webfrancy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 webfrancy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
oracle 8.0 subselect bugs

Code:
SELECT * FROM (
    SELECT c_rrn
    FROM (
      SELECT * FROM gvsa.tgvs32_tra, gvsa.tgvs30_esi_tra, gvsa.tgvs31_esi_val, gvsa.tgvs33_soc
      WHERE d_ora_arr >= TO_DATE('11062003200000', 'DDMMYYYYHH24MISS')
      AND d_ora_arr <= TO_DATE('11062003235959', 'DDMMYYYYHH24MISS')
      AND gvsa.tgvs30_esi_tra.c_esi_tra=gvsa.tgvs32_tra.c_esi_tra
      AND gvsa.tgvs31_esi_val.c_esi_val=gvsa.tgvs32_tra.c_esi_val
      AND gvsa.tgvs33_soc.c_soc=gvsa.tgvs32_tra.c_soc
      ORDER BY c_rrn
    )
  )
  WHERE ROWNUM <= 10
I have some problems with this query.. can u help me?
in Oracle 8.0 it returns no data

Reply With Quote
  #2  
Old March 4th, 2004, 10:29 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 4 h 53 m 59 sec
Reputation Power: 259
So what? How can you say it's a bug?

Reply With Quote
  #3  
Old March 4th, 2004, 11:55 AM
cruelkoder's Avatar
cruelkoder cruelkoder is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 49 cruelkoder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 40 sec
Reputation Power: 5
Did the inner sub query gave any output. If so is that the name of the table in your schema

Reply With Quote
  #4  
Old March 11th, 2004, 04:45 AM
webfrancy webfrancy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 webfrancy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I read (somewhere) that subselect doesn't support ORDER BY clause.

data returned from my subselect are not in order..

I can't understand..

Reply With Quote
  #5  
Old March 11th, 2004, 05:39 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 4 h 53 m 59 sec
Reputation Power: 259
Let's see if I got the problem:
You are running this query:
Quote:
SELECT * FROM gvsa.tgvs32_tra, gvsa.tgvs30_esi_tra, gvsa.tgvs31_esi_val, gvsa.tgvs33_soc
WHERE d_ora_arr >= TO_DATE('11062003200000', 'DDMMYYYYHH24MISS')
AND d_ora_arr <= TO_DATE('11062003235959', 'DDMMYYYYHH24MISS')
AND gvsa.tgvs30_esi_tra.c_esi_tra=gvsa.tgvs32_tra.c_esi_tra
AND gvsa.tgvs31_esi_val.c_esi_val=gvsa.tgvs32_tra.c_esi_val
AND gvsa.tgvs33_soc.c_soc=gvsa.tgvs32_tra.c_soc
ORDER BY c_rrn

which contains a c_rrn column, right? So why run a:
Quote:
SELECT c_rrn
FROM (
SELECT * FROM gvsa.tgvs32_tra, ...

when you can select it directly?
Then you want only the first ten results, right?

Reply With Quote
  #6  
Old March 11th, 2004, 10:18 AM
webfrancy webfrancy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 webfrancy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yes, the problem is more complex than you think, but I have not explained very well the situation.
that's because my english is not so good, but now I try to express me better.
I have to paginate my data (PHP application)
I tried to optimize my select
Code:
SELECT c_rrn, c_act_cod "Act code"
FROM gvsa.tgvs32_tra
WHERE d_ora_arr >= TO_DATE('11032003000000', 'DDMMYYYYHH24MISS')
AND d_ora_arr <= TO_DATE('11032004171007', 'DDMMYYYYHH24MISS') ORDER BY c_rrn
but there's a problem. I don't have a LIMIT clause as in MySql.
can you help me?
thank you very much!!

Reply With Quote
  #7  
Old March 11th, 2004, 11:01 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 4 h 53 m 59 sec
Reputation Power: 259
The best way (IMHO) to paginate data in oracle is to use a Stored Procedure, use Google and you should find examples

Reply With Quote
  #8  
Old March 11th, 2004, 11:24 AM
webfrancy webfrancy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 webfrancy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
The best way (IMHO) to paginate data in oracle is to use a Stored Procedure, use Google and you should find examples

thank you

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > oracle 8.0 subselect bugs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway