RE: ERROR when inserting csv values into sql table

From: David Raymond <David(dot)Raymond(at)tomtom(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: RE: ERROR when inserting csv values into sql table
Date: 2019-06-13 14:08:32
Message-ID: VI1PR07MB5792CC504D19198B54AA7EC087EF0@VI1PR07MB5792.eurprd07.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

LINE 1: INSERT INTO movies(title, year, runtime, 'imdbID', 'imdbRati...

You used single quotes for the part with column names. Double quotes are for identifies, single quotes are string literals. So it looks like it need to be

insert_statement = sqlalchemy.text('INSERT INTO movies(title, year, runtime, "imdbID", "imdbRating") VALUES (:title, :year, :runtime, :imdbID, :imdbRating)')

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Anthony E. Greene 2019-06-14 20:20:26 Re: ERROR when inserting csv values into sql table
Previous Message Bzzzz 2019-06-13 12:19:06 Re: ERROR when inserting csv values into sql table