“column not allowed here” error in INSERT statement

前端 未结 8 2423
心在旅途
心在旅途 2020-12-05 17:39

I created this table called LOCATION by doing this:

CREATE TABLE LOCATION(
POSTCODE VARCHAR(10) PRIMARY KEY,
STREET_NAME VARCHAR(20),
CITY VARCHAR(20));
         


        
8条回答
  •  [愿得一人]
    2020-12-05 18:21

    Like Scaffman said - You are missing quotes. Always when you are passing a value to varchar2 use quotes

    INSERT INTO LOCATION VALUES('PQ95VM','HAPPY_STREET','FRANCE');
    

    So one (') starts the string and the second (') closes it.

    But if you want to add a quote symbol into a string for example:

    My father told me: 'you have to be brave, son'.

    You have to use a triple quote symbol like:

    'My father told me: ''you have to be brave, son''.'

    *adding quote method can vary on different db engines

提交回复
热议问题