Oracle10g Oracle 10g Insert查询作为查询与过程执行时不一致,并且执行时也不相同
我面临一个非常奇怪的问题,我在一个过程中有一个insert语句。。。 差不多Oracle10g Oracle 10g Insert查询作为查询与过程执行时不一致,并且执行时也不相同,oracle10g,Oracle10g,我面临一个非常奇怪的问题,我在一个过程中有一个insert语句。。。 差不多 inert into oracle_Table SELECT cr.a AS a, cr.b AS b, cr.c AS c, max(d.column_name) as d FROM "table 1"@Pmo.World Cr, table2@Pmo.World d
inert
into oracle_Table
SELECT cr.a AS a,
cr.b AS b,
cr.c AS c,
max(d.column_name) as d
FROM "table 1"@Pmo.World Cr,
table2@Pmo.World d
WHERE d."a" = cr."column name"
GROUP BY cr.a,
cr.b,
cr.c
@World是指向MSSQL的数据库链接
我现在遇到的问题是,每次我将此插入作为查询运行时。一切都按它应该的样子运行。。。但是,当我将此插入放入过程中时,它不会插入任何内容
考虑到字符转换问题,我将程序更改为
inert
into oracle_Table
SELECT to_char(cr.a) AS a,
to_char(cr.b) AS b,
to_char(cr.c) AS c,
max(d.column_name) as d
FROM "table 1"@Pmo.World Cr,
table2@Pmo.World d
WHERE d."a" = cr."column name"
GROUP BY cr.a,
cr.b,
cr.c
然后这个插入器在程序中工作。。。然而,当我将其还原为不需要字符的原始版本时。。。它还在工作。。。然后我让它运行了几天。。。由于它每天运行一次,它在前两天工作,然后在第三天停止工作。。。
我验证了源表,每次运行此过程时,源表都不是空的。。。
这是如此令人困惑,因为如果我手动将insert作为查询运行,那么每次运行它时它都会工作。。。然而,如果我把它放入一个程序中,它会不时地起作用 a、b、c的类型为varchar2,而我在插入之后有commit。。。 例如 如果我有一个测试程序
declare
-- Local variables here
i integer;
begin
inert
into oracle_Table
SELECT cr.a AS a,
cr.b AS b,
cr.c AS c,
max(d.column_name) as d
FROM "table 1"@Pmo.World Cr,
table2@Pmo.World d
WHERE d."a" = cr."column name"
GROUP BY cr.a,
cr.b,
cr.c
end;
commit;
无法插入任何内容什么是
cr.a
、cr.b
和cr.c
的数据类型?a
、b
和c
的数据类型是什么?可能是您不总是提交吗?我确实在插入后提交了。。。通过使用物化视图解决了此问题。。。但原因仍然没有找到。。。