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

Home -> Community -> Usenet -> c.d.o.server -> Re: Subquery within PL/SQL fails

Re: Subquery within PL/SQL fails

From: Bricklen <bricklen-rem_at_yahoo.comz>
Date: Thu, 02 Oct 2003 21:25:02 GMT
Message-ID: <OI0fb.43429$H86.1019869@news1.telusplanet.net>


Nathan wrote:

> Hi:
> When i try running the following query in my pl/sql block,
> SELECT chatsessiontoken into latesttoken,assignedstatus into
> assignstatusfromdb FROM (SELECT * FROM from tbl_crmvisitorinfo where
> visiturl=url and clientip=ip order by chatsessiontoken desc) WHERE
> ROWNUM<2;
>
> i get the following error:
> Line # = 24 Column # = 59 Error Text = PL/SQL: ORA-00923: FROM keyword
> not found where expected
> Line # = 24 Column # = 3 Error Text = PL/SQL: SQL Statement ignored
>
> I run oracle version: 9.0.1.1.1
>
> Any help is appreciated.
>
> I am trying to get the top 1 row, after ordering desc.
>
> Thanks,
> Nathan

your INTO is incorrect:

SELECT chatsessiontoken,assignedstatus
into latesttoken,assignstatusfromdb
FROM (SELECT * FROM from tbl_crmvisitorinfo where visiturl=url and clientip=ip order by chatsessiontoken desc) WHERE ROWNUM<2; Received on Thu Oct 02 2003 - 16:25:02 CDT

Original text of this message

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