简体   繁体   English

如何解决 Oracle Apex 中的无效列错误?

[英]How to resolve invalid column error in Oracle Apex?

I am trying to add a plsql script that will update a event after "Apply Changes" button is pressed in a form.我正在尝试添加一个 plsql 脚本,该脚本将在按下表单中的“应用更改”按钮后更新事件。 So I added a new "Dynamic Action" to click event of that button, set the action to "Execute PL/SQL CODE" and wrote the following script in "PL/SQL Code" section所以我添加了一个新的“动态操作”来单击该按钮的事件,将操作设置为“执行 PL/SQL 代码”并在“PL/SQL 代码”部分编写了以下脚本

BEGIN
UPDATE EVENT
SET START_DATE = :P53_START_DATE,
END_DATE = :P53_END_DATE,
START_TIME = :P53_START_TIME,
END_TIME = :P53_END_TIME,
DESCRIPTION = :P53_DESCRIPTION,
WHERE EVENT_ID = :P53_EVENT_ID;
END;
/

But I keep getting this error when I hit "Apply Changes"但是当我点击“应用更改”时,我一直收到这个错误

在此处输入图像描述

Is there anything wrong in the way I am selection the values from the fields using "P53_....."?我使用“P53_.....”从字段中选择值的方式有什么问题吗?

在此处输入图像描述

How may I solve resolve this issue?我该如何解决这个问题?

Your update statement references :P53_NEW.EVENT_NAME for the table column START_DATE .您的更新语句引用:P53_NEW.EVENT_NAME表列START_DATE That cannot be right.那不可能是对的。 Replace it with the correct variable.用正确的变量替换它。

there are several things wrong with this code:这段代码有几处错误:

BEGIN
UPDATE EVENT
SET START_DATE = :P53_START_DATE, << suggest using TO_DATE(:P53_START_DATE,'<your date format mask>') instead
END_DATE = :P53_END_DATE, << suggest using TO_DATE(:P53_END_DATE,'<your date format mask>') instead
START_TIME = :P53_START_TIME,
END_TIME = :P53_END_TIME,
DESCRIPTION = :P53_DESCRIPTION, << this comma makes statement fail
WHERE EVENT_ID = :P53_EVENT_ID; 
END;
/ << trailing slash not needed

But as I said in the comments, are you sure you need a dynamic action for this?但正如我在评论中所说,你确定你需要为此采取动态行动吗? The "apex way" of doing anything on a page submit is to execute pl/sql code in page processes on submit.在页面提交上执行任何操作的“最高方式”是在提交时在页面进程中执行 pl/sql 代码。 Dynamic actions are designed to be used if code needs to be executed without submitting the case.如果需要在不提交案例的情况下执行代码,则可以使用动态操作。 This is just a comment, it is unrelated to your actual question.这只是评论,与您的实际问题无关。

--Koen --柯恩

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决“无法从具有 DISTINCT、GROUP BY 等的视图中获取或采样 select ROWID”。 Oracle Apex 错误? - How to resolve "cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc." error in Oracle Apex? 如何解决 Oracle Apex 中的“无法从具有 DISTINCT、GROUP BY 等的视图进行更新的 select”错误? - How to resolve "cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc" error in Oracle Apex? SQL apex oracle 错误消息 ORA-00902: 无效数据类型 - SQL apex oracle error message ORA-00902: invalid datatype 如何解决Oracle数据库中缺少或无效的选项? - How to resolve the missing or invalid option in oracle database? oracle apex输入错误 - oracle apex input error 我如何解决 oracle sql 中的无效数字 ORA-06512 错误 - how do i resolve invalid number ORA-06512 error in this in oracle sql 如何解决 cx_Oracle.DatabaseError: DPI-1043: invalid number 错误? - How to resolve cx_Oracle.DatabaseError: DPI-1043: invalid number error? "oracle apex 中定义不明确的列?" - column ambiguously defined in oracle apex? 如何在SQL查询Oracle Apex中的列之后添加新行 - How to add a new line after a column in sql query Oracle Apex 如何将自动完成功能添加到oracle apex表格形式报表中的列 - how to add autocomplete function to a column in oracle apex tabular form report
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM