这是一个简单的过程,它定义了 2 个数字字段,1 作为数字,另一个作为十进制,但是当我将这两个字段都传递给另一个过程时,十进制字段被四舍五入为 0 dp,即
IAMOUNT 以 9875.4321 结束,但 IUNITS 以 123 结束
CREATE OR REPLACE PROCEDURE apex_public_user.badbdcall2
AS
iamount NUMBER(15, 7);
iunits DECIMAL(15, 7);
BEGIN
iamount := 9875.4321;
iunits := 123.567;
BEGIN
BADBDCALL2CALLME(
IAMOUNT => iamount,
IUNITS => iunits
);
END;
END;
接收 SQL:
CREATE OR REPLACE PROCEDURE badbdcall2callme(iamount IN OUT DECIMAL,
iunits IN OUT DECIMAL)
AS
in_ds1 bde1000ds%ROWTYPE;
BEGIN
in_ds1.iamount := iamount;
in_ds1.iunits := iunits;
END;
如果我调试代码,我可以看到 IUNITS 变为 38,0,这是小数的默认值,而 IAMOUNT 变为 NUMBER(没有 15,7),但我认为参数继承了传递给它的字段的大小.