Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORDER BY in sub-select doesn't compile in Pro*C 8.1.6 - why not?
Spencer, thanks for the tips. Sorry for not including text of the error msg. It is below.
We ended up solving the problem by adding an index to the ORDETAIL table
that would ensure the index be used by Oracle so that the rownum could be
effective.
Pro*C/C++: Release 8.1.6.0.0 - Production on Sun Jun 3 12:25:20 2001
(c) Copyright 1999 Oracle Corporation. All rights reserved.
System default option values taken from: /u01/app/oracle/product/8.1.6/precomp/admin/pcscfg.cfg
Syntax error at line 96, column 30, file /wms/work/zmarjans/csiint/src/precomp/osf51/oescrn_dbafSelectOrDetail.pcc:
Error at line 96, column 30 in file
/wms/work/zmarjans/csiint/src/precomp/osf51/
oescrn_dbafSelectOrDetail.pcc
order by wskuskuskuid .............................1
PCC-S-02201, Encountered the symbol "by" when expecting one of the following:
, ) union, connect, group, having, intersect, minus, start,
where, with,
The symbol "group," was substituted for "by" to continue.
Zoran.
"Spencer" <spencerp_at_swbell.net> wrote in message
news:GBkS6.222$Z42.11659_at_nnrp1.sbc.net...
> "Zoran Marjanski" <zoranm_at_sympatico.ca> wrote in message
> news:wYeS6.13420$S2.1037996_at_newsread2.prod.itd.earthlink.net...
> > We have Oracle 8i (8.1.6) and Pro*C 8.1.6 pre-compiler and the following
SQL
> > is NOT pre-compiling. Pro*C doesn't like the ORDER BY clause in the
> > sub-select. We need the order by in the sub-select to make the rownum
clause
> > in the outer select do it's job.
> >
> > EXEC SQL select order_idbase, order_idsub, line, wskuskuskuid
> > into :order_idbase, :order_idsub, :line
> > from (select order_idbase, order_idsub, line,
> > wskuskuskuid
> > from ordetail
> > order by wskuskuskuid
> > )
> > where rownum < 10
> > ;
> > The query however is supported by Oracle 8i and executes just fine in
> > SQL*Plus.
> >
> > Does anyone know, how to get the pre-compiler to like this syntax with
the
> > order by in the sub-select?
> >
> > Thanks, Zoran.
> >
>
>
>
>
>
>
>
>
>
>
>
>
> > from ordetail
> > order by wskuskuskuid
>
>
> from ORDETAIL_ORDBY_WSKUSKUSKUID
>
>
>
> > >Received on Sun Jun 03 2001 - 11:31:28 CDT
![]() |
![]() |