【发布时间】:2014-04-02 19:40:01
【问题描述】:
我可以知道如何将记录类型值传递给函数参数吗?
以下是我的尝试。我收到“调用中的参数数量或类型错误...”错误 我已经搜索过,但似乎找不到对我有帮助的明确答案。
希望有人能回答。
DECLARE
TYPE attribute_type_record IS RECORD
(
name VARCHAR2(100)
,value VARCHAR2(400)
,ind integer
);
type attribute_type is table of attribute_type_record index by binary_integer;
sid_att attribute_type;
ret varchar2(3000);
BEGIN
sid_att(1).name := 'SID_ATTRIBUTES.REFERENCE1';
sid_att(1).value := 'SID_ATTRIBUTES.REFERENCE1';
sid_att(1).ind := '1';
--v_row := sid_attributes_table('SID_ATTRIBUTES.REFERENCE1');
ret := SC$DATA_ENTRY.ins_sid_attributes(sid_att(1).name,
sid_att(1).value,
sid_att(1).ind,
'594191176',
'TEST');
END;
FUNCTION ins_sid_attributes (
p_sid_attributes_table sc$data_entry_utilities.attribute_table,
p_sid_id sid_attributes.sid_id%TYPE,
p_user IN VARCHAR2
)
RETURN VARCHAR2
IS
error_message VARCHAR2 (2000);
v_row sc$data_entry_utilities.attribute_type;
empty_row sc$data_entry_utilities.attribute_type;
v_order INTEGER := 0;
v_name VARCHAR2 (2000);
cat_table pkg_utilities.number_table;
-- I did not post the rest of the code of this function since i believe it is irrelevant to the error and to keep it short.
提前致谢! 没有
【问题讨论】:
-
您的记录类型仅在匿名块中声明 - 它对您的包不可见,因此该函数将无法使用它。您可能需要声明一个
sc$data_entry_utilities.attribute_table类型的局部变量才能传递给函数。
标签: oracle plsql syntax-error