SQL *Plus Ignore Ampersands

From NazimWIKI
Revision as of 21:53, 8 November 2019 by Admin (talk | contribs) (Created page with "In SQL *Plus when an ampersand (&) is encountered, Oracle treats it as a value prompt. For example, if you try to execute the following statement: <blockquote><pre> INSERT...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In SQL *Plus when an ampersand (&) is encountered, Oracle treats it as a value prompt.

For example, if you try to execute the following statement:

INSERT INTO DEPARTMENT (DEPARTMENT_NAME) VALUES ('Finance & Treasury'); 

SQL *Plus will return a prompt:

Enter value for Treasury:

To have SQL *Plus ignore the ampersand, use the following command prior to executing your query:

SET DEFINE OFF
INSERT INTO DEPARTMENT (DEPARTMENT_NAME) VALUES ('Finance & Treasury');