syntax error on insert

  • Hi, I am brand new to SQL.  I'm using postgres with PopSQL interface.

    I am trying to run the following basic code from a tutorial but it gives me a Failed Error:

    syntax error at or near "INSERT"

     

    Here is the code:

    CREATE TABLE people (

    id INT,

    name VARCHAR(255),

    PRIMARY KEY(id)

    )

    INSERT INTO people VALUES (1, 'Corey');

  • This is a SQL Server forum but...Add a semicolon at the end of the closing parenthesis from the create table -

    CREATE TABLE people (

    id INT,

    name VARCHAR(255),

    PRIMARY KEY(id)

    );

    INSERT INTO people VALUES (1, 'Corey');

    Sue

     

  • Thank-you so much!  you fixed the issue!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply