什么@! 意味着在从声明(What does @ ! mean in a From Statem

2019-09-20 06:00发布

我想确定一下这个代码做什么(甲骨文SQL) -尤其是在签收感叹号from子句。

INSERT INTO "LOCATIONS" "A1"
            ("LOCATION_ID",
             "SEQUENCE",
             "POINT_TYPE")
SELECT "A2"."LOCATION_ID",
       "A2"."SEQUENCE",
       "A2"."LOCATION_TYPE",
       "A2"."POINT_TYPE"
FROM   "LOCATIONS"@! "A2"
WHERE  NOT EXISTS (SELECT 1
                   FROM   "LOCATIONS" "A3"
                   WHERE  "A3"."LOCATION_ID" = "A2"."LOCATION_ID") 

Answer 1:

这是一个反向数据库链接到原始数据库,在执行查询。 原来的查询必须是这样的:

INSERT INTO LOCATIONS@remote_db
            ("LOCATION_ID",
             "SEQUENCE",
             "POINT_TYPE")
SELECT "A2"."LOCATION_ID",
       "A2"."SEQUENCE",
       "A2"."POINT_TYPE"
FROM   "LOCATIONS" A2
WHERE  NOT EXISTS (SELECT 1
                   FROM   LOCATIONS@remote_db A3
                   WHERE  "A3"."LOCATION_ID" = "A2"."LOCATION_ID");

这样,所有的远程表成为当地,和当地表远程成为“@!”。



Answer 2:

我不认为这是有效的SQL。 检查你的代码,以确保不会发生任何变化之前执行的SQL -特别检查,看是否有数据库链接的名称被取代的了!

如果你不能确定正在执行什么,你可以把一个跟踪数据库上



文章来源: What does @ ! mean in a From Statement