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: Alternative to UNION

Re: Alternative to UNION

From: <sybrandb_at_yahoo.com>
Date: 28 Jun 2006 07:58:59 -0700
Message-ID: <1151506739.747181.234890@i40g2000cwc.googlegroups.com>

Al wrote:
> I'm trying to create a view in Oracle that will be accessed by a
> vendor application. Apparently the vendor app does something weird when
> it access a view that uses a UNION or UNION ALL statement. Is there an
> alternate method to UNION that can give the same result? The query
> below is a simplified version. Any help would be appreciated.
> -Thanks, Al Benvin
>
> CREATE OR REPLACE VIEW COMBO_V AS
> SELECT *
> FROM (SELECT ID
> FROM TABLE1)
> UNION ALL
> (SELECT ID
> FROM TABLE2) ;
Your inline view is unnecessary. However it will probably not be ignored.

You could find out what 'something weird' is by using Explain plan. I suspect the vendor's where clause is merged into the view, where it should not be, or vice versa.
Depending on version, this can be turned off.  

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Wed Jun 28 2006 - 09:58:59 CDT

Original text of this message

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