开发者

Sybase query doesn't work in Oracle

开发者 https://www.devze.com 2023-04-04 20:23 出处:网络
DELETEUserDB..UserAccount FROM UserDB..UserAccount A, CustDB..ETS_Profile B WHERE A.UserId = B.User_Id
DELETE  UserDB..UserAccount
  FROM UserDB..UserAccount A, CustDB..ETS_Profile B  
 WHERE A.UserId = B.User_Id
   and  B.Category = 'Customer'
   AND B.Sub_Category = 'Teir'
   and B.Item_Name = 'CUSTODIAN'

The above is a Sybase query which works well. I am creating a handler for UserDB and executing this query in Oracle

In oracle I am getting errors if i give the query as below

DELETE UserAccount 
  FROM UserAccount A,CustDB.ETS_Profile B开发者_高级运维
 where A.UserId = B.User_Id
   and  B.Category = 'Customer'
   and B.Sub_Category = 'Teir'
   and B.Item_Name = 'CUSTODIAN';


You should probably formulate the query as below:

DELETE FROM UserAccount A
 WHERE EXISTS
       ( SELECT NULL
           FROM CustDB.Ets_Profile B
          WHERE B.user_id = A.UserId
            AND B.Category = 'Customer'
            AND B.Sub_Category = 'Teir'
            AND B.Item_Name = 'CUSTODIAN'
       );
0

精彩评论

暂无评论...
验证码 换一张
取 消