Board index » delphi » SQL "inner join" and Oracle

SQL "inner join" and Oracle

I'm using a SQL "select ... inner join ..." when accessing an Oracle
database and I get the message "SQL command not properly ended".

Does 'inner join' works with Oracle. When not, would it exist another
way to join data from two tables?

TIA

Reinaldo

 

Re:SQL "inner join" and Oracle


Run your query in SQL*Plus.  If it works there, it should work in Delphi.
If not, you will get a more sensible errormessage in SQL*Plus.

Roger

Reinaldo P. Santana <dsant...@mandic.com.br> wrote in message
news:370d6f9f.1380462@forums.inprise.com...

Quote
> I'm using a SQL "select ... inner join ..." when accessing an Oracle
> database and I get the message "SQL command not properly ended".

> Does 'inner join' works with Oracle. When not, would it exist another
> way to join data from two tables?

> TIA

> Reinaldo

Re:SQL "inner join" and Oracle


On Sat, 10 Apr 1999 23:59:03 +0200, "Roger Arnesen"

Quote
<why.sho...@you.care> wrote:
>Run your query in SQL*Plus.  If it works there, it should work in Delphi.
>If not, you will get a more sensible errormessage in SQL*Plus.

>Roger

Thanks for the tip. I'll try it.

Reinaldo

Re:SQL "inner join" and Oracle


the inner join syntax is ansi 92 sql - oracle DOES NOT FULLY SUPPORT
ANSI 92 - only a subset !
an inner join on two tables is done this way:

select a.col1, b.col1
from a, b
where a.primary_key = b.foreignkey

outer join (supposing a always exists):
select a.col1, b.col1
from a, b
where a.primary_key = b.foreignkey(+)
The '+' sign in brackets tells oracle to outer join left from a to b !

yours

On Fri, 09 Apr 1999 03:16:22 GMT, dsant...@mandic.com.br (Reinaldo P.

Quote
Santana) wrote:
>I'm using a SQL "select ... inner join ..." when accessing an Oracle
>database and I get the message "SQL command not properly ended".

>Does 'inner join' works with Oracle. When not, would it exist another
>way to join data from two tables?

>TIA

>Reinaldo

Christian Kaas, c.k...@odn.de
Quote
>Software-, Projektrealisierung u. Beratung
>640kB ought to be enough memory ! - Bill Gates 1981

Re:SQL "inner join" and Oracle


You dont need to mention INNER JOIN in Orcale
Joins are INNER by default.

Oracle doesnt like this knd of synatx

Quote
Reinaldo P. Santana wrote in message <3710a9ea.905...@forums.inprise.com>...
>On Sat, 10 Apr 1999 23:59:03 +0200, "Roger Arnesen"
><why.sho...@you.care> wrote:

>>Run your query in SQL*Plus.  If it works there, it should work in Delphi.
>>If not, you will get a more sensible errormessage in SQL*Plus.

>>Roger

>Thanks for the tip. I'll try it.

>Reinaldo

Re:SQL "inner join" and Oracle


By the way, an outer join requires a (+) before or after the equal sign
(with the parentheses) dependign on wether you want a left or right outer
join.

Quote
Paul Thompson wrote in message <7f3kbu$hn...@forums.borland.com>...
>You dont need to mention INNER JOIN in Orcale
>Joins are INNER by default.

>Oracle doesnt like this knd of synatx

>Reinaldo P. Santana wrote in message

<3710a9ea.905...@forums.inprise.com>...
Quote
>>On Sat, 10 Apr 1999 23:59:03 +0200, "Roger Arnesen"
>><why.sho...@you.care> wrote:

>>>Run your query in SQL*Plus.  If it works there, it should work in Delphi.
>>>If not, you will get a more sensible errormessage in SQL*Plus.

>>>Roger

>>Thanks for the tip. I'll try it.

>>Reinaldo

Re:SQL "inner join" and Oracle


Hi Reginaldo,

I think "inner join" will not work in Oracle,

You can use instead :  ....A.key1 = B.Key2 (+)....

Carlos

Quote
Reinaldo P. Santana wrote in message <3710a9ea.905...@forums.inprise.com>...
>On Sat, 10 Apr 1999 23:59:03 +0200, "Roger Arnesen"
><why.sho...@you.care> wrote:

>>Run your query in SQL*Plus.  If it works there, it should work in Delphi.
>>If not, you will get a more sensible errormessage in SQL*Plus.

>>Roger

>Thanks for the tip. I'll try it.

>Reinaldo

Re:SQL "inner join" and Oracle


(+) is for an outer join in Oracle.
Quote
Caio Palmer wrote:
> Hi Reginaldo,

> I think "inner join" will not work in Oracle,

> You can use instead :  ....A.key1 = B.Key2 (+)....

> Carlos

> Reinaldo P. Santana wrote in message <3710a9ea.905...@forums.inprise.com>...
> >On Sat, 10 Apr 1999 23:59:03 +0200, "Roger Arnesen"
> ><why.sho...@you.care> wrote:

> >>Run your query in SQL*Plus.  If it works there, it should work in Delphi.
> >>If not, you will get a more sensible errormessage in SQL*Plus.

> >>Roger

> >Thanks for the tip. I'll try it.

> >Reinaldo

Other Threads