By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,501 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,501 IT Pros & Developers. It's quick & easy.

INNER JOIN

P: n/a
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!

Jul 19 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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

Jul 19 '05 #2

P: n/a
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" <an*******@hotmail.com> wrote in message
news:0tqHb.41585$BQ5.35902@fed1read03...
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

Jul 19 '05 #3

P: n/a
> 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
Jul 19 '05 #4

P: n/a
Hello Hans,

Here is an example statement:

SELECT Table1.StartDate, Table2.Description
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" <fo******@yahoo.net> wrote in message
news:3F***************@yahoo.net...
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

Jul 19 '05 #5

P: n/a
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:

SQL> SELECT 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" <fo******@yahoo.net> wrote in message
news:3F***************@yahoo.net...
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

Jul 19 '05 #6

P: n/a
Barry Young wrote:

Hello Hans,

Here is an example statement:

SELECT Table1.StartDate, Table2.Description
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.StartDate, Table2.Description
FROM Table1, Table2
WHERE Table1.ID = Table2.ID;
Jul 19 '05 #7

P: n/a
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:

SQL> SELECT 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.
Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.