Solved

Oracle 8i syntax

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
order a table based on column relationship (parent-child), can it be done? 4 42
Remove alpha from alphanumeric 4 60
How to free up undo space? 3 29
SQL Query Syntax Join 4 34
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
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.

867 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

24 Experts available now in Live!

Get 1:1 Help Now