java.sql.SQLException:ORA-06530:对未初始化复合的引用

时间:2011-11-16 21:40:32

标签: sql plsql

不确定是什么导致此错误。我在我们的一个软件包中乱搞并尝试使用一些Java代码运行一个过程。你能告诉我我做错了什么吗?也许是Java或SQL?

PROCEDURE update_object_comment (p_object_comment IN OUT objects_comment_bean, p_user_id IN user_list.user_id%TYPE)
IS
    t_object_comment objects_comment_bean;
BEGIN

    SELECT get_comments (p_object_comment.id,t_object_comment.type )
      INTO t_object_comment
      FROM DUAL;

    -- We only perform the update if something really changed
    IF NOT p_object_comment.equals (t_object_comment)
    THEN
        -- Copy what was in the database so that we are positive
        -- that the created information can never change.
        p_object_comment.auditable := t_object_comment.auditable;
-- <<<< <<<<<<<<<<<<<<<<<<<<<<IT SAYS THE ERROR IS HAPPENING HERE>>>>>>>>>>>>>>>>>>>>>>>>>>>
        -- The modified date has to be set on update (but not creation)
        p_object_comment.auditable.modified_date := SYSDATE;
        p_object_comment.auditable.modified_by := p_user_id;

        UPDATE object_comments
           SET comment = p_object_comment.comment,
               auditable = p_object_comment.auditable
         WHERE id = p_object_comment.id
         AND type = p_object_comment.type;


    END IF;

END update_object_comment;  

1 个答案:

答案 0 :(得分:0)

找到答案:

SELECT get_comments (p_object_comment.id,t_object_comment.type ) 

应该是:

SELECT get_comments (p_object_comment.id,p_object_comment.type )