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 not valid in a cursor?

Re: Subquery not valid in a cursor?

From: Mark <markg_at_mymail.co.uk>
Date: 4 Apr 2002 04:28:06 -0800
Message-ID: <ddb31653.0204040428.1e616fae@posting.google.com>


This syntax works in a particular verson of Oracle and SQL (can't remember version numbers). Try the Oracle website to find out if it works for the Oracle version and SQL /PLSQL version you are using.

M

"sylvain tremblay" <syltrem_at_videotron.ca> wrote in message news:<t0Qq8.42841$Be7.2073405_at_weber.videotron.net>...
> Hi
>
> From the doc, subqueries are valid inside the FROM and WHERE clause
> but can someone tell me if this is valid? I get an error at compile time.
> If it`s not valid, then how should I do this kind of query in PL/SQL ?
>
> Thanks
> Syltrem
>
> Cursor Open_Order_Cur
> is Select ORDER_NUMBER, SALES_ORDER_TYPE,
> CUSTOMER_REFERENCE, ORDER_DATE, USERNAME,
> WEIGHT, VOLUME, SOP_ORDER_TOTAL_CURRENCY,
> STATUS_FLAG,
> (Select Count(*)
> From FINANCE.SALES_ORDER_LINES L
> Where L.COMPANY_CODE = H.COMPANY_CODE
> And L.DIVISION = H.DIVISION
> And L.ORDER_NUMBER = H.ORDER_NUMBER)
> From FINANCE.SALES_ORDER_HEADERS H
> Where H.COMPANY_CODE = P_Company
> And H.DIVISION = P_Division
> And H.CUSTOMER_NUMBER = P_Customer_Id
> And H.STATUS_FLAG <> 'C';
Received on Thu Apr 04 2002 - 06:28:06 CST

Original text of this message

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