我想初始化
MY_PERSON_TABLE
表中的列
FN_INITIALIZE
作用
下面是代码。这个问题可以看作是
this question
我面临的问题是,我无法编译代码并为FNAME,ID分配一些值。
create table MY_PERSON_TABLE
(
ID NUMBER(20),
FNAME VARCHAR2(30)
);
CREATE SYNONYM SYNONYM_PERSONAL FOR MY_PERSON_TABLE;
CREATE OR REPLACE PACKAGE TEST IS
TYPE TY_PERSONAL IS TABLE OF SYNONYM_PERSONAL%ROWTYPE INDEX BY BINARY_INTEGER;
TYPE TY_PERSON IS RECORD(
PERSONAL TY_PERSONAL
);
END TEST;
CREATE OR REPLACE PACKAGE TEST_BODY IS
FUNCTION FN_INITIALIZE(P_ACTION IN VARCHAR2) RETURN BOOLEAN IS
L_TO_INITIALIZE TY_PERSON;
BEGIN
L_TO_INITIALIZE.PERSONAL := NEW SYNONYM_PERSONAL();
--The above code throws "PLS-00222: no function with name .. exists in the scope"
--How to initialiaze the value of FNAME & ID of MY_PERSON_TABLE?
END FN_INITIALIZE;
END TEST_BODY;
BEGIN