SQL Oracle PLS-00363: 表达式 '' 不能用作赋值目标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9977229/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 15:07:49  来源:igfitidea点击:

Oracle PLS-00363: expression '' cannot be used as an assignment target

sqloracleplsql

提问by Doc Holiday

Hello not sure why Im getting this error. Basically I get it in these three lines:

你好不知道为什么我收到这个错误。基本上我在这三行中得到它:

PLS-00363: expression 'p_temp_foo.editable.modified_by' cannot be used as an assignment target
PLS-00363: expression 'p_temp_foo.editable.date' cannot be used as an assignment target
PLS-00363: expression 'p_temp_foo.editable.modified_by' cannot be used as an assignment target

procedure:

程序:

 PROCEDURE run_temp_procedure (p_temp_foo IN part_bean, p_member_number IN NUMBER)
 IS
 t_temp_foo part_bean;
  now   DATE;
  BEGIN
  now := SYSDATE;

             p_temp_foo.editable:= t_temp_foo.editable;
        p_temp_foo.editable.date := SYSDATE;
        p_temp_foo.editable.modified_by := p_member_number;


  END run_temp_procedure ;

回答by N West

p_temp_foois an INparameter. By nature, these are read only. You could define it as an IN OUTparameter, or an OUTparameter.

p_temp_foo是一个IN参数。本质上,这些是只读的。您可以将其定义为IN OUT参数或OUT参数。

For more info see here: http://plsql-tutorial.com/plsql-passing-parameters-procedure-function.htm

有关更多信息,请参见此处:http: //plsql-tutorial.com/plsql-passing-parameters-procedure-function.htm

回答by elfekz

Generate new VARCHAR2 type variable to assign your IN (input) string.

生成新的 VARCHAR2 类型变量以分配您的 IN(输入)字符串。

procedure sp_name(
ps_list              IN VARCHAR2,
...
other IN's and OUT's
...
)
as

ps_list_copy          VARCHAR2 (32000); 

begin 
ps_list_copy := ps_list;
...
do your works with ps_list_copy
...
...
Exception when others then
....
end sp_name;