Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"quoted string not properly terminated" sqlplus [closed]

Getting an error when I try to insert values using the following statement

INSERT INTO PRODUCT (PRODUCT_NUM, ITEM_NUM, DATE)
VALUES (’11’,’19’, TO_DATE(’01-JAN-2001’,’DD-MON-YYYY’));

ERROR:
ORA-01756: quoted string not properly terminated

like image 976
user3315642 Avatar asked Sep 17 '14 02:09

user3315642


4 Answers

Your question has "smart" quotes in the SQL instead of basic single quotes. Try this:

INSERT INTO PRODUCT(PRODUCT_NUM, ITEM_NUM, DATE)
    VALUES ('11', '19', DATE '2001-01-01')

(I prefer the date keyword for specifying date constants in Oracle.)

like image 186
Gordon Linoff Avatar answered Nov 12 '22 23:11

Gordon Linoff


INSERT INTO PRODUCT (PRODUCT_NUM, ITEM_NUM, DATE)
VALUES ('11','19', TO_DATE('01-JAN-2001','DD-MON-YYYY'));

use this code as you used wrong quote type

like image 30
ravi chaudhary Avatar answered Nov 13 '22 00:11

ravi chaudhary


It's almost certainly because you're using the wrong quote types, something that often happens when you cut'n'paste text from a word processor.

Your example has "angled" quotes rather than the correct ' variant, meaning that either that's the actual problem, or that you've transcribed it incorrectly which leads me to think you're not matching quotes correctly.

This is what you should have:

INSERT INTO PRODUCT (PRODUCT_NUM, ITEM_NUM, DATE)
    VALUES ('11','19', TO_DATE('01-JAN-2001','DD-MON-YYYY'));
like image 3
paxdiablo Avatar answered Nov 12 '22 23:11

paxdiablo


use a normal quote, your quote seems to be odd.

like image 2
Peter Pei Guo Avatar answered Nov 13 '22 01:11

Peter Pei Guo