INNER JOIN

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Barry Young

    INNER JOIN

    I am using Access to create a SQL query. It creates an Inner Join Query. I cut and paste the query into PL-SQL. When I try to execute the query I get an error.

    ORA 933 SQL command not properly ended.

    It highlights the INNER JOIN statement on the SQL command.

    Can someone recommend a utility to convert these Microsoft or Access SQL queries to PL SQL?

    Thanks!





  • Ana C. Dent

    #2
    Re: INNER JOIN

    Barry Young wrote:
    I am using Access to create a SQL query. It creates an Inner Join
    Query. I cut and paste the query into PL-SQL. When I try to execute the
    query I get an error.
    >
    ORA 933 SQL command not properly ended.
    >
    It highlights the INNER JOIN statement on the SQL command.
    >
    Can someone recommend a utility to convert these Microsoft or Access SQL
    queries to PL SQL?
    In many cases what is needed another line following the end for the
    SQL-statement. This line should contain a single "/" as the leftmost and
    only character on the line


    HTH & YMMV

    Comment

    • Barry Young

      #3
      Re: INNER JOIN

      Hello Ana,

      Thanks for the reply...

      Can you please give me an example of what you are referring to?

      Thanks again!

      Barry


      "Ana C. Dent" <anacedent@hotm ail.comwrote in message
      news:0tqHb.4158 5$BQ5.35902@fed 1read03...
      Barry Young wrote:
      I am using Access to create a SQL query. It creates an Inner Join
      Query. I cut and paste the query into PL-SQL. When I try to execute the
      query I get an error.

      ORA 933 SQL command not properly ended.

      It highlights the INNER JOIN statement on the SQL command.

      Can someone recommend a utility to convert these Microsoft or Access SQL
      queries to PL SQL?
      >
      In many cases what is needed another line following the end for the
      SQL-statement. This line should contain a single "/" as the leftmost and
      only character on the line
      >
      >
      HTH & YMMV
      >

      Comment

      • Hans Forbrich

        #4
        Re: INNER JOIN

        Barry Young wrote:
        >
        I am using Access to create a SQL query. It creates an Inner Join
        Query. I cut and paste the query into PL-SQL. When I try to execute
        the query I get an error.
        >
        ORA 933 SQL command not properly ended.
        >
        It highlights the INNER JOIN statement on the SQL command.
        >
        Can someone recommend a utility to convert these Microsoft or Access
        SQL queries to PL SQL?
        >
        Thanks!
        >
        Please post your SQL statement, and the target Oracle version. If it's
        proper SQL it should run on plain Oracle (since Oracle runs as close to
        the standard as any) but the version number is certainly a big help.

        Ana C. Dent suggested adding a line with a slash "/" as the only thing
        on the line. No leading or trailing charaters (not even a blank).
        Something like

        SELECT * FROM TAB
        /

        or

        SELECT TNAME
        FROM TAB
        /


        Please note, PL/SQL is Oracle's procedural programming language (doing
        roughly the same as Sybase's Transact-SQL (AKA Microsoft's T-SQL)).
        These languages try to put procedural stuff (sequential statements,
        loops, conditions, etc) around SQL. I suspect you are trying to use
        plain SQL rather than the slightly more complex PL/SQL.

        HTH
        /Hans

        Comment

        • Barry Young

          #5
          Re: INNER JOIN

          Hello Hans,

          Here is an example statement:

          SELECT Table1.StartDat e, Table2.Descript ion
          FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID;

          INNER JOIN is what is giving me the ORA 933 SQL command not properly ended.

          This is just a piece of the code.. In the final statement there will be
          NESTED INNER JOINS.. So I may have to do Unions??

          Any help would be appreciated.

          Thanks!

          Barry


          "Hans Forbrich" <forbrich@yahoo .netwrote in message
          news:3FEE4824.3 6EB0ACB@yahoo.n et...
          Barry Young wrote:

          I am using Access to create a SQL query. It creates an Inner Join
          Query. I cut and paste the query into PL-SQL. When I try to execute
          the query I get an error.

          ORA 933 SQL command not properly ended.

          It highlights the INNER JOIN statement on the SQL command.

          Can someone recommend a utility to convert these Microsoft or Access
          SQL queries to PL SQL?

          Thanks!
          >
          Please post your SQL statement, and the target Oracle version. If it's
          proper SQL it should run on plain Oracle (since Oracle runs as close to
          the standard as any) but the version number is certainly a big help.
          >
          Ana C. Dent suggested adding a line with a slash "/" as the only thing
          on the line. No leading or trailing charaters (not even a blank).
          Something like
          >
          SELECT * FROM TAB
          /
          >
          or
          >
          SELECT TNAME
          FROM TAB
          /
          >
          >
          Please note, PL/SQL is Oracle's procedural programming language (doing
          roughly the same as Sybase's Transact-SQL (AKA Microsoft's T-SQL)).
          These languages try to put procedural stuff (sequential statements,
          loops, conditions, etc) around SQL. I suspect you are trying to use
          plain SQL rather than the slightly more complex PL/SQL.
          >
          HTH
          /Hans

          Comment

          • Barry Young

            #6
            Re: INNER JOIN

            Hans,

            Well I think what appears to be the problem is that Pre Oracle 9i does not
            support the INNER JOIN. I am using 8i so I will have to restructure the SQL
            query similar to this:

            SQLSELECT c.course_name, c.period, e.student_name
            2 FROM course c, enrollment e
            3 WHERE c.course_name = e.course_name
            4 AND c.period = e.period;

            I thought INNER JOINS were an ANSI SQL standard. I was surprised that
            ORACLE doesn't support the INNER JOIN. Unless I am wrong.

            Barry



            "Hans Forbrich" <forbrich@yahoo .netwrote in message
            news:3FEE4824.3 6EB0ACB@yahoo.n et...
            Barry Young wrote:

            I am using Access to create a SQL query. It creates an Inner Join
            Query. I cut and paste the query into PL-SQL. When I try to execute
            the query I get an error.

            ORA 933 SQL command not properly ended.

            It highlights the INNER JOIN statement on the SQL command.

            Can someone recommend a utility to convert these Microsoft or Access
            SQL queries to PL SQL?

            Thanks!
            >
            Please post your SQL statement, and the target Oracle version. If it's
            proper SQL it should run on plain Oracle (since Oracle runs as close to
            the standard as any) but the version number is certainly a big help.
            >
            Ana C. Dent suggested adding a line with a slash "/" as the only thing
            on the line. No leading or trailing charaters (not even a blank).
            Something like
            >
            SELECT * FROM TAB
            /
            >
            or
            >
            SELECT TNAME
            FROM TAB
            /
            >
            >
            Please note, PL/SQL is Oracle's procedural programming language (doing
            roughly the same as Sybase's Transact-SQL (AKA Microsoft's T-SQL)).
            These languages try to put procedural stuff (sequential statements,
            loops, conditions, etc) around SQL. I suspect you are trying to use
            plain SQL rather than the slightly more complex PL/SQL.
            >
            HTH
            /Hans

            Comment

            • Hans Forbrich

              #7
              Re: INNER JOIN

              Barry Young wrote:
              >
              Hello Hans,
              >
              Here is an example statement:
              >
              SELECT Table1.StartDat e, Table2.Descript ion
              FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID;
              >
              INNER JOIN is what is giving me the ORA 933 SQL command not properly ended.
              >
              This is just a piece of the code.. In the final statement there will be
              NESTED INNER JOINS.. So I may have to do Unions??
              >
              Any help would be appreciated.
              >
              Thanks!
              Try eliminating the semi-colon. SQL statements themselves do not use a
              semi-colon. However many of the languages/environments that call SQL do
              need a 'statement terminator' and many of those use a semi-colon. In
              many cases (eg: cut & paste) will accidently include the semi-colon as
              part of the SQL statement instead of an environment statement
              terminator.

              Also note that the 'new' ANSI syntax (INNER JOIN, NATURAL JOIN, etc.) is
              only supported when dealing with Oracle9i and higher. If you are going
              against an older version (Oracle8i, Oracle8, Oracle 7) then you need to
              fall back to the old syntax which would be

              SELECT Table1.StartDat e, Table2.Descript ion
              FROM Table1, Table2
              WHERE Table1.ID = Table2.ID;

              Comment

              • Hans Forbrich

                #8
                Re: INNER JOIN

                Barry Young wrote:
                >
                Hans,
                >
                Well I think what appears to be the problem is that Pre Oracle 9i does not
                support the INNER JOIN. I am using 8i so I will have to restructure the SQL
                query similar to this:
                >
                SQLSELECT c.course_name, c.period, e.student_name
                2 FROM course c, enrollment e
                3 WHERE c.course_name = e.course_name
                4 AND c.period = e.period;
                >
                I thought INNER JOINS were an ANSI SQL standard. I was surprised that
                ORACLE doesn't support the INNER JOIN. Unless I am wrong.
                >
                Barry
                >
                The new JOIN syntax is not available below Oracle9i.

                As for being an ANSI SQL standard, you are likely running into a timing
                issue, as follows:

                Oracle8 series (which ends with Oracle8i Release 3 or 8.1.7.x) was
                released around 1997. Flip side, ANSI SQL has had 3 major revisions -
                '87 (IIRC), '92 and '99. If I'm not mistaken, that JOIN syntax was
                introduced in SQL '92 (but had holes) and was completed in '99. Not the
                kind of thing I'd hold against Oracle, especially since there was a
                perfectly acceptable workaround.

                All the more reason to move to Oracle9i. Especially since Oracle did
                announce End of Life for 8i.

                Comment

                Working...