4

I am trying to run the following basic UPDATE statement

UPDATE [gcp-or:babynames.names_2014] SET name = "Emma B" WHERE name = "Emma"

However, I am getting the following error: "Query Failed Error: 1.1 - 1.76: Unrecognized token UPDATE"

Error

Any suggestions?

Thanks -Oscar

1 Answers1

4

You must use standard SQL for DML functionality. To enable standard SQL, see Enabling Standard SQL

the easiest way is as below

#standardSQL  
UPDATE `gcp-or.babynames.names_2014` SET name = "Emma B" WHERE name = "Emma"
Mikhail Berlyant
  • 165,386
  • 8
  • 154
  • 230
  • Thanks for your prompt respons – Oscar Rodriguez Jan 16 '17 at 19:49
  • 2
    For Apache AirFlow users, BigQueryOperator runs with `use_legacy_sql=True` by default. Be sure to set it to False. https://github.com/apache/airflow/blob/db4be19b80a65913edb5ab634226cf60ea8bffea/airflow/gcp/operators/bigquery.py#L487 – gecko655 Nov 25 '19 at 05:31