如何在oracle 11g中的sqlplus中更改定界符

编程入门 行业动态 更新时间:2024-10-10 14:26:29
本文介绍了如何在oracle 11g中的sqlplus中更改定界符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想更改定界符:

有人可以帮我在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中更改定界符

本文发布于:2023-11-13 02:31:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583177.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   定界   oracle   sqlplus

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!