Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL question: update on a join
Hi, Oracle experts,
I have converted a Sybase/MS SQL code to Oracle which does an update on join like the following but it does not work the same. Can some SQL guru figure out a better way to do this?, thanks.
Sybase/MS SQL code:
UPDATE IPLogWork
SET PortID = LogProtocolCacheWork.PortID FROM IPLogWork IPLogWork,
LogProtocolCacheWork LogProtocolCacheWork WHERE IPLogWork.PortNumber = LogProtocolCacheWork.PortNumber AND IPLogWork.Protocol = LogProtocolCacheWork.ProtocolID
Oracle SQL Code:
UPDATE IPLogWork
SET PortID =
(SELECT PortID FROM LogProtocolCacheWork WHERE PortNumber = IPLogWork.PortNumber AND ProtocolID = IPLogWork.Protocol )
All the IPLogWork.PortID become NULL if there is no match. This is incorrect.
Leslie Received on Fri Apr 11 1997 - 00:00:00 CDT
![]() |
![]() |