[英]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.