0

从 Oracle,通过 DBLINK,我试图更新 MS-SQL Server 数据库中日期字段中的值。

但是,当我运行此查询时

update axp@mis
SET "ExpireDate" = '2013-06-04 12:00:00'
WHERE "IdNumber" = 103;

我收到消息:

[Error] Execution (13: 16): ORA-28534: Heterogeneous Services preprocessing error

我也试过

update axp@mis
SET "ExpireDate" = to_date('2013-06-04 12:00:00','yyyy-mm-dd HH24:MI:SS')
WHERE "IdNumber" = 103;

我得到消息:

[Error] Execution (14: 1): ORA-02070: database MISDOORACCESS does not support TO_NUMBER in this context

谁能建议我如何从 Oracle 执行此更新?

4

1 回答 1

1

您必须使用 CAST 功能。尝试这个:

declare
     v_date date:=to_date('2013-06-04 12:00:00','yyyy-mm-dd HH24:MI:SS');
begin
     update axp@mis set "ExpireDate"=cast(v_date as date) WHERE "IdNumber" = 103;
     commit;
end;
于 2016-01-13T18:11:28.233 回答