Reputation: 77
I have a SQL table on Google Cloud (which I will call table_name here). It has three columns, which I will refer to as:
I am trying to enter a new row with the following query:
insert into table_name (col_1, col_2, col_3)
values ("some_string", "some_string_2", "2021-08-01 04:28:00");
However, it is returning an error
column "some_string" does not exist
All of the data types should be correct, and I'm pretty sure the syntax of this query is correct, so what could be happening here?
Upvotes: 0
Views: 251
Reputation: 77
I was able to fix this by using the query
INSERT INTO table_name VALUES ('some_string', 'some_string_2', TO_TIMESTAMP('2021-08-01 04:28:11', 'YYYY-MM-DD HH:MI:SS');
I will accept John Hanley's answer, though, as the double quotes were also an error.
Upvotes: 0
Reputation: 81336
Change double-quotes to single-quotes:
values ('some_string', 'some_string_2', '2021-08-01 04:28:00');
Double-quotes are not used to indicate strings in SQL. Enforcement varies with database vendors.
Upvotes: 3