2012-09-07 50 views

回答

4

你不需要參數的函數 的名稱後的括號內,你需要對身體的定義加時賽的構造:

create or replace type FooBar as object 
(
    bar NUMBER(1,0) 
    ,constructor function FooBar return self as result 
); 
/


create or replace type body FooBar is 

    constructor function FooBar return self as result 
    IS 
    BEGIN 
    RETURN; 
    END; 
end; 
/


    declare 
    foo foobar; 
    begin 
     foo := foobar(); 
    end; 
/
+0

您還需要在任何子類來定義參數的構造函數。 – duck9

相關問題