PLS-00321错误

时间:2013-02-27 08:46:42

标签: plsqldeveloper

我已声明如下记录

TYPE pg_wad_usr_portgrp_rec IS RECORD (
   user_id npe_user.user_id%TYPE,
   Portal_grp_name npe_portal_grp.protal_group_name%TYPE
);

当我在下面的程序中使用相同的值时出现错误

PROCEDURE add_rmv_usr_portal_grp (
                       p_user_portal_grp   IN   pg_wad_usr_portgrp_tab,
                       p_status            OUT   VARCHAR2 )
Begin
pg_wad_usr_portgrp_rec := p_user_portal_grp;

错误:

02:34:11.795    DBMS    npeproc -- PLS-00321: expression 'PG_WAD_USR_PORTGRP_REC' is inappropriate as the left hand side of an assignment statement

2 个答案:

答案 0 :(得分:0)

表达式不指定可以赋值的变量。例如,函数SYSDATE不能出现在赋值语句的左侧

TYPE pg_wad_usr_portgrp_rec是RECORD(user_id npe_user.user_id%TYPE) pg_wad_usr_portgrp_data pg_wad_usr_portgrp_rec;

答案 1 :(得分:0)

首先,定义是pg_wad_usr_portgrp_rec和参数类型pg_wad_usr_portgrp_tab,因此不确定是否需要使用复合类型或复合类型集合。无论如何,你不能为类型定义赋值。

DECLARE
  TYPE pg_wad_usr_portgrp_rec IS RECORD 
  (
     user_id npe_user.user_id%TYPE,
     Portal_grp_name npe_portal_grp.protal_group_name%TYPE
  );

  TYPE pg_wad_usr_portgrp_tab IS TABLE OF pg_wad_usr_portgrp_rec;

  PROCEDURE add_rmv_usr_portal_grp (
           p_user_portal_grp   IN   pg_wad_usr_portgrp_tab,
           p_status            OUT   VARCHAR2) AS

    lpg_wad_usr_portgrp_tab pg_wad_usr_portgrp_tab;
  BEGIN
    lpg_wad_usr_portgrp_tab := p_user_portal_grp;
  END;
BEGIN
  null;
END;
/