Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: insane error?

Re: insane error?

From: kev <kevin.porter_at_fast.no>
Date: Tue, 14 Sep 1999 18:02:12 +0100
Message-ID: <37DE7F94.25E01504@fast.no>


Norris wrote:

> Can you use temporary table to store intermediate results rather than using view?

I'm using PHP remember, so that would mean selecting a whole resultset, then doing lots of insert statements into a new table, then selecting 10 from that. I feel this would also be far too slow, slower even than my original solution. Perhaps it possible to do all the mucking about with temp tables on the Oracle server side of things. PL/SQL perhaps? I wouldn't know how to do it though!

>
>
> In comp.databases.oracle.misc kev <kevin.porter_at_fast.no> wrote:
> > Jonathan Lewis wrote:
>
> >> Order by in views is not legal in 8.0.5,
> >> so the error arises because a closing
> >> bracket is expected after
> >> > AND category.sect = section.id
> >>
>
> > Ah, I see. How else should it be done then?
> > It seems to me that I'm only trying to do what many other people must need
> > to do also. Surely there is a way this can be done satisfactorily?
>
> > - Kev
>
> >>
> >> --
> >>
> >> Jonathan Lewis
> >> Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk
> >>
> >> kev wrote in message <37DE1595.361C4E1A_at_fast.no>...
> >> >Hi,
> >> >
> >> >I'm trying to subquery a select statement to allow me to get the Nth 10
> >> >rows of a result set (I'm using Oracle 8.0.5 on Linux RH6 using PHP3).
> >> >My original query looks like this (i've removed some of it, but I can
> >> >assure you this is a valid query that returns the resultset I want):
> >> >
> >> >SELECT headline.headline, headline.url, headline.grabtime
> >> > FROM headline, category, headline_category_link, section
> >> > WHERE headline_category_link.headline = headline.id
> >> > AND headline_category_link.category = category.id
> >> > :
> >> > :
> >> > AND category.sect = section.id
> >> > ORDER BY grabtime DESC
> >> >
> >> >and my new version of it, to just retrieve the first 10 rows, looks like
> >> >this:
> >> >
> >> >SELECT * FROM (
> >> > SELECT headline.headline, headline.url, headline.grabtime
> >> > FROM headline, category, headline_category_link, section
> >> > WHERE headline_category_link.headline = headline.id
> >> > AND headline_category_link.category = category.id
> >> > :
> >> > :
> >> > AND category.sect = section.id
> >> > ORDER BY grabtime DESC )
> >> > WHERE rownum between 1 and 10
> >> >
> >> >Now, this looks OK to me, but I get this error message when trying to
> >> >execute it:
> >> >
> >> >ORA-00907: missing right parenthesis
> >> >
> >> >and I am absolutely stumped. What's wrong with the query. Is there a
> >> >paranthesis missing? I can't see where.
> >> >Or is there a better way to do this?
> >> >
> >> >
> >> >thanks,
> >> >
> >> >- Kev
> >> >
>
> --
> - Have several nice days...
> - Opinions are mine and do not necessarily reflect those of the Corp.
> http://www.ntfaq.com
> http://www.cyberport.com/~tangent/programming/winsock/
Received on Tue Sep 14 1999 - 12:02:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US