Re: Oracle Syntax Help

From: Kevin P. Fleming <kfleming_at_access-laserpress.com>
Date: Wed, 19 Aug 1998 19:02:54 GMT
Message-ID: <yjFC1.535$435.2892632_at_news.rdc1.az.home.com>


Well, it looks like you're putting the table "emp_address" on the outer side of the join, so the Oracle syntax would be:

  ...
  e.empid = ea.empid(+) AND
  ...

This will create ea records where none exist to satisfy the join. However, these records will never be in the result set, because you're later check for 'ea.prim_addr = 'T'', but it will be NULL for all the records created by the outer join.

Doug Stone wrote in message ...
>The following SQL contains an outer join.
>
>This code works fine with Sybase SQLA, but not
>with Oracle.
>
>Does anyone know how to re-write this SQL
>without the "*=" reference?
>
>Begin SQL ***********
>SELECT e.emp_id, e.first_name, e.last_name, ea.phone_nbr, u.descr
> FROM employee e, emp_address ea
> WHERE e.prim_group = :group_id AND
> e.prim_skill = :skill_lvl_id AND
> e.prim_shift = :shift_id AND
> e.emp_id *= ea.emp_id AND
> e.emp_id > 0 AND ea.prim_addr = 'T'
>ORDER BY e.last_name, e.first_name ASC
>End SQL ***************
>
>Thank you,
>Doug
>
>
Received on Wed Aug 19 1998 - 21:02:54 CEST

Original text of this message