Solved

Oracle 8i syntax

Posted on 2009-05-15
3
510 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can i make query faster by writing T-SQL? 6 36
Run SQL Server Proc from Access 11 31
Mysql Left Join Case 10 54
performance query 4 23
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

773 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