Solved

Oracle 8i syntax

Posted on 2009-05-15
3
504 Views
Last Modified: 2013-12-19
I have a SQL statement that I wrote in 9i. I tried to run it in Visual studio and apparently the oracle data adapter that we are using only recognizes the 8i syntax. I wanted to know if anyone knew how to convert the following statement into its equivilent 9i counterpart...

SELECT DISTINCT CC.CABLE_NUMBER, CD.DRAWING_NUMBER  
           FROM  (CMS_DUC.CABLE CC LEFT JOIN EIDB_DUC.CABLE EC
                      ON CC.CABLE_NUMBER = EC.CABLE_NO)  
I                     INNER JOIN CMS_DUC.DRAWING CD  
                      ON CC.MASTER_SCHEMATIC = CD.DRAWING_ID
         WHERE EC.CABLE_NO Is Null
         ORDER BY CC.CABLE_NUMBER  ;
0
Comment
Question by:imonfireDAMMIT
  • 2
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24399548
oracle 8 does not know the JOIN syntax:
SELECT DISTINCT CC.CABLE_NUMBER, CD.DRAWING_NUMBER  
    FROM CMS_DUC.CABLE CC 
      , EIDB_DUC.CABLE EC
      , CMS_DUC.DRAWING CD  
      WHERE CC.CABLE_NUMBER (+) = EC.CABLE_NO
        AND CC.MASTER_SCHEMATIC = CD.DRAWING_ID 
        AND EC.CABLE_NO Is Null 
     ORDER BY CC.CABLE_NUMBER  ;

Open in new window

0
 
LVL 1

Author Comment

by:imonfireDAMMIT
ID: 24399738
Thank YOU SOOO MUCH...i was pretty close. I had this:

SELECT DISTINCT CC.CABLE_NUMBER, CD.DRAWING_NUMBER  
        From  cms_duc.cable cc, eidb_duc.cable ec, cms_duc.drawing cd
        where cc.master_schematic = cd.drawing_id
              and ec.cable_no = cc.cable_number (+)
              and ec.cable_no is null
        order by cc.cable_number;   I see that my error was in the placement of the (+)...i put it on the other side of the = and it worked...

Your statement also put the (+) on the wrong side. WHen I switched it...it worked. The Left join was on the Cable_NO column.

THANKS!! i am understanding this much better now
0
 
LVL 1

Author Closing Comment

by:imonfireDAMMIT
ID: 31582101
thank you...i was pulling out my hair all day with this and it turned out that I was soooo close...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now