Inserting a string with double quotes into a table

后端 未结 3 1964
面向向阳花
面向向阳花 2021-01-12 10:13

I\'m using Oracle 10g and I\'m having a problem inserting a string with double quotes into a table. This is my statement

INSERT INTO USERS (ID, NAME, USERNAM         


        
3条回答
  •  一生所求
    2021-01-12 10:41

    It is possible. In Oracle, you quote string literals using single quotes.

    If you want to insert test into the database then you must quote that as 'test'.

    INSERT INTO USERS (NAME) VALUES ('test');
    

    If you want to insert "test" into the database then you must quote that as '"test"'.

    INSERT INTO USERS (NAME) VALUES ('"test"');
    

提交回复
热议问题