Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Semicolon and Single Quote Issue in SQL Insert Statements

SQL_UsersMar 7 2017 — edited Mar 7 2017

Hello,

I am executing a SQL script which has spaces, semicolons, single-quotes, special characters etc. in of the column called prod_desc.

I need to execute the script from SQLPLUS. I have the set the following in the SQLPLUS however, single quotes, semicolons are not taken into consideration.

    set sqlblanklines on

See the below insert statement for instance, semicolon is after the line break. This is causing an error during execution. How can I resolve the issue?

SET DEFINE OFF;

Insert into PROD_DESC

   (PROD_NO, PROD_DESC

    )

Values

   ('XYZ', 'test

semicolon test;

'

);

Table Structure

CREATE TABLE prod_desc

(

   prod_no     VARCHAR2 (100),

   prod_desc   VARCHAR2 (1000)

);

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2017
Added on Mar 7 2017
16 comments
5,822 views