设置定义关闭在 Oracle SQL Developer 中不起作用 [英] Set define off not working in Oracle SQL Developer
问题描述
我正在使用连接到 Oracle 数据库的 SQL 开发人员,并且我正在尝试创建一个如下所示的触发器:
I'm using SQL developer connected to an Oracle database, and I'm trying to create a trigger that looks something like below:
CREATE OR REPLACE TRIGGER my_trigger BEFORE
UPDATE ON ZONE FOR EACH ROW BEGIN :new.LAST_UPDATED_DTTM := SYSTIMESTAMP ;
END;
/
我遇到的问题是 ":new" 导致 SQL 开发人员提示输入变量 "new" 的值(尝试绑定变量).
The problem I'm having is that the ":new" causes SQL developer to prompt for the value of the variable "new" (to try to bind the variable).
我尝试使用:
set define off;
它执行成功,但仍然提示我输入变量的值.
It executes successfully, but I'm still prompted to enter a value for the variable.
知道该怎么做吗?
推荐答案
如果我使用运行脚本"选项,触发器会按预期创建.
The trigger is created as expected if I use the "Run Script" option.
如果我尝试使用Run Statement (Ctrl+enter)"运行 create 语句,它不起作用.
If I try to run the create statement using "Run Statement (Ctrl+enter)" it doesn't work.
所以为了成功创建脚本,我只需要在窗口中放置触发器创建语句并使用运行脚本".
So to successfully create the script I had to put only the trigger creation statements in the window and use "Run Script".
这篇关于设置定义关闭在 Oracle SQL Developer 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!