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
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.)
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
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'));
use a normal quote, your quote seems to be odd.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With