我尝试使用扩展Oracle的ORDImage类型创建新类型。但是我不能使用新类型。
ORA-02315错误的构造数
我该怎么办?我应该为新类型添加新的构造函数吗?怎么样?
CREATE TYPE ORDSYS.ORDtest AUTHID CURRENT_USER UNDER ORDSYS.ORDImage ( deneme NUMBER );
CREATE TABLE image_test (id number, image ORDSYS.ORDtest);
CREATE OR REPLACE PROCEDURE load_test(in_id INTEGER,
in_dir VARCHAR2,
in_fname VARCHAR2)
AS
obj ORDSYS.ORDTEST;
ctx RAW(64) := NULL;
BEGIN
INSERT INTO image_test VALUES
(in_id, ORDSYS.ORDtest('FILE', in_dir, in_fname))
RETURNING image INTO obj;
obj.import(ctx);
UPDATE image_test SET image = obj WHERE id = in_id;
COMMIT;
END;
/
LINE/COL ERROR
-------- -----------------------------------------------------------------
8/4 PL/SQL: SQL Statement ignored
9/16 PL/SQL: ORA-02315: incorrect number of arguments for default
constructor