Results 1 to 5 of 5

Thread: Is this Oracle View the same as this SQL View?

  1. #1

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721

    Is this Oracle View the same as this SQL View?

    Hi

    You will have to excuse my ignorance but is this Oracle view the
    equivalent to this SQL View??
    Code:
    Oracle
    
    CREATE OR REPLACE VIEW e612.vw_area_child (
       area_code,
       area_name,
       row_active_ind,
       area_parent,
       area_child )
    AS
    select
    tbl_area_master.*,
    tbl_area_relation.*
    from
    tbl_area_master ,
    tbl_area_relation
    where tbl_area_relation.area_child  =  tbl_area_master.area_code(+)
    Code:
    SQL
    
    CREATE VIEW [VW_AREA_CHILD]
    AS SELECT [dbo].[TBL_AREA_MASTER].[AREA_CODE], [dbo].[TBL_AREA_MASTER].[AREA_NAME], [dbo].[TBL_AREA_MASTER].[ROW_ACTIVE_IND], [dbo].[TBL_AREA_RELATION].[AREA_PARENT], [dbo].[TBL_AREA_RELATION].[AREA_CHILD]
    FROM [dbo].[TBL_AREA_MASTER], [dbo].[TBL_AREA_RELATION]
    where dbo.tbl_area_relation.area_child  =  dbo.tbl_area_master.area_code

    Thanks
    ** HOLLY **

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    cleaned up a bit:
    Code:
    CREATE VIEW VW_AREA_CHILD
    AS SELECT AREA_CODE, AREA_NAME, ROW_ACTIVE_IND, AREA_PARENT, AREA_CHILD
    FROM TBL_AREA_MASTER
    INNER JOIN TBL_AREA_RELATION
    ON tbl_area_relation.area_child  =  tbl_area_master.area_code
    And besides the fact that the all caps on the tables & field names drive me nuts....
    That should jsut about do it.


    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    They are not the same. The Oracle view uses a Left Join, which is indicated by the (+) after tbl_area_master.area_code. The SQL view has an Inner Join.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by brucevde
    They are not the same. The Oracle view uses a Left Join, which is indicated by the (+) after tbl_area_master.area_code. The SQL view has an Inner Join.
    I wondered about that (never worked w/ Oracle)....
    This then would be the equivelent, no?
    Code:
    CREATE VIEW VW_AREA_CHILD
    AS SELECT AREA_CODE, AREA_NAME, ROW_ACTIVE_IND, AREA_PARENT, AREA_CHILD
    FROM TBL_AREA_MASTER
    LEFT JOIN TBL_AREA_RELATION
    ON tbl_area_relation.area_child  =  tbl_area_master.area_code
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    Thanks alot techgnome........ and thanks brucevde for spotting the obvious...I too wondered what the + was for???

    Thanks for your help!
    ** HOLLY **

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width