如何在oracle 11g中的sqlplus中更改定界符 [英] how to change the delimiter in sqlplus in oracle 11g
问题描述
我想更改定界符:
有人可以帮我在Oracle 11g中更改sqlplus中的分隔符吗?
Can someone help me to change the delimiter in sqlplus in Oracle 11g
CREATE OR REPLACE TRIGGER test_trigger
BEFORE INSERT ON test
REFERENCING NEW AS NEW FOR EACH ROW
BEGIN
SELECT test_sequence.nextval INTO :NEW.ID FROM dual;
END;
/
这是我要创建的触发器.但是在Select语句之后它由于停止;在那儿.这就是为什么我想更改定界符.希望大家现在都明白这一点.
this is the trigger I want to create. but after Select statement it stops because of ; is there. that is why I want to change the delimiter. I hope everyone gets the idea on this now..
推荐答案
触发器的语法没有错.我可以在我的(原始)SQL * Plus环境中运行它:
There is nothing wrong with the syntax of your trigger. I can run it in my (vanilla) SQL*Plus environment:
SQL> CREATE OR REPLACE TRIGGER test_trigger
2 BEFORE INSERT ON test
3 REFERENCING NEW AS NEW FOR EACH ROW
4 BEGIN
5 SELECT test_sequence.nextval INTO :NEW.ID FROM dual;
6 END;
7 /
Trigger created.
SQL>
哦!触发器起作用:
SQL> insert into test (col1) values ('Simples!')
2 /
1 row created.
SQL> select * from test
2 /
ID COL1
---------- ------------
1 Simples!
SQL>
我能想到的是您正在键入的代码中有一些空行.如果是这种情况,您可以使用以下SQL * Plus命令覆盖默认行为:
All I can think is that you have some blank lines in the code which you are typing. If this is the situation you can override the default behaviour with this SQL*Plus command:
SQL> set sqlblanklines on
这篇关于如何在oracle 11g中的sqlplus中更改定界符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!