update student set :P9_COLUMNNAME = :P9_VALUE这是我的尝试,但它回来了
ORA06550错误user.table列、table.column或列规范无效。
通常,当我从用户输入中设置值时,它工作得很好,但是这次oracle不允许我以这种方式传递列值。有人遇到过同样的问题吗?提前感谢
附注:P9_columnname是选择列表,p9_value是文本字段。
发布于 2020-12-27 11:19:49
UPDATE应该用于更新表列,而不是Apex应用程序中的项。
所以,要么
update student set
some_column = :P9_VALUE
where ... --> don't forget the WHERE clause, otherwise you'll update the whole table或
:P9_COLUMNNAME := :P9_VALUE;如果Select项包含列名,则必须使用动态SQL。例如:
declare
l_str varchar2(200);
begin
l_str := 'update student set ' || :P9_COLUMNNAME || ' = ' || :P9_VALUE;
execute immediate l_str;
end;别忘了where条款!
https://stackoverflow.com/questions/65465054
复制相似问题