Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enter special characters like "&" in oracle database? [duplicate]

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'); 

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

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

like image 858
Rachel Avatar asked Nov 14 '10 00:11

Rachel


People also ask

How do I enter a special character code?

Inserting ASCII characters To insert an ASCII character, press and hold down ALT while typing the character code. For example, to insert the degree (º) symbol, press and hold down ALT while typing 0176 on the numeric keypad. You must use the numeric keypad to type the numbers, and not the keyboard.

How do I get the alternate characters on my keyboard?

Make sure the NumLock key is on, and then hold the Alt key. While holding Alt , use the numeric keypad to type one of the three-digit numbers listed below. When you are done typing, release the Alt key, and the associated extended character will appear.

How do you type weird letters on a keyboard?

On Windows, you can enter special characters directly from the keyboard using the numeric keypad. To do this, you must hold down the ALT key while typing a sequence of numbers. Each sequence corresponds to a different character.


1 Answers

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

SQL> set define off; 

before executing the SQL statement. That turns off the checking for substitution variables.

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.

like image 118
Justin Cave Avatar answered Sep 22 '22 22:09

Justin Cave