如何输入特殊字符(例如“&”)在oracle数据库中? [英] How to enter special characters like "&" in oracle database?

查看:429
本文介绍了如何输入特殊字符(例如“&”)在oracle数据库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的insert语句中插入特殊字符& 。我的插入是:

I want to insert special character & in my insert statement. My insert is:

INSERT INTO STUDENT(name, class_id) VALUES ('Samantha', 'Java_22 & Oracle_14');

如果我试图运行这个查询我得到一个弹出窗口,它要求输入 Oracle_14

If I try to run this query I am getting a popup and it asks me to enter value for Oracle_14.

如何在oracle db的insert语句中输入如& 的特殊字符?

How can I enter special characters like & in the insert statement for oracle db?

推荐答案

如果您在SQL * Plus或SQL Developer中,您想要运行

If you are in SQL*Plus or SQL Developer, you want to run

SQL> set define off;

这样的SET指令是客户端工具(SQL * Plus或SQL Developer)的指令。他们有会话范围,所以你必须在每次连接时发出指令(如果要更改默认值,将DEFINE设置为OFF,可以将指令放在客户端计算机的glogin.sql中)。没有风险会影响数据库中的任何其他用户或会话。

SET directives like this are instructions for the client tool (SQL*Plus or SQL Developer). They have session scope, so you would have to issue the directive every time you connect (you can put the directive in your client machine's glogin.sql if you want to change the default to have DEFINE set to OFF). There is no risk that you would impact any other user or session in the database.

这篇关于如何输入特殊字符(例如“&”)在oracle数据库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆