3
創建一個SQL對象:我如何Oracle調用自己的類型成員函數
create type foo_type as object (
bar integer(2),
bar2 varchar(200),
member function get return integer
)
和我實現了我喜歡的類型的身體:
CREATE TYPE BODY foo_type as
member function get return integer is
begin
return bar;
END;
END;
然後,我創建了一個表,此類型:
CREATE TABLE test_table(
foo1 foo_type
)
我插了一行:
INSERT INTO test_table (foo1) VALUES (foo_type(1, 'a'))
我想,這是調用這樣的:
SELECT foo1.get() FROM test_table
但它沒有工作。