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: Pro C precompile problem with UNION and ORDER BY

Re: Pro C precompile problem with UNION and ORDER BY

From: Ed Prochak <prochak_at_my-dejanews.com>
Date: Fri, 26 Feb 1999 21:11:44 GMT
Message-ID: <7b72m6$tik$1@nnrp1.dejanews.com>


In article <7b6d0u$8ln$1_at_nnrp1.dejanews.com>,   kshave_at_health.gov.mb.ca wrote:
> I have the following piece of code that works in SQLPLUS ...
>
> select
> payee_last_name
> from claim, client
> where claim.client_id=client.client_id
> and claim.gsas=client.gsas
> union
> select
> payee_last_name
> from adjustment, client
> where adjustment.pharmacy_client_id=client.client_id
> and adjustment.gsas=client.gsas
> order by payee_last_name;
>
> However, the same code in my Pro C (2.3.3) gives the following error ...
>
> select
> ...1
> (1) PCC-S-02423, ORDER BY item must be the number of a SELECT-list expression
>
> select
> ...1
> (1) PCC-S-02000, SQL Statement ignored
>
> Semantic error at line 166, column 4, file DP20020.pc:
> select
> ...1
> (1) PCC-S-02346, PL/SQL found semantic errors
>
> I managed to get the statement to compile under Pro C but changing the ORDER
> BY statement to ...
>
> ORDER BY 1;
> (the first column).
>
> Why won't the original statement work in Pro C if it works under SQLPLUS?
>
> -Keith
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

Because the SQL interpreters are slightly different. The one in SQL*PLUS is a little more powerful.

Ed Prochak
Magic Interface, Ltd.
ORACLE services
440-498-3702

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Feb 26 1999 - 15:11:44 CST

Original text of this message

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