0

I have a question regarding performing insert into a table in BigQuery using the DBAPI .

The simple insert of 1 value I was able to preform , my question is how to preform insert of list of values.

I couldn't find an example on how to do it, I want to preform something like :

query ="insert into test.test values (%s)"
self._cursor.execute(query,(('4'),('3')))

But I am getting an error

Thanks,

Nir

Nir Elbaz
  • 556
  • 4
  • 19

1 Answers1

0

You can try the command executemany. This method is used to insert multiple rows in a single operation.

Your code should look something like:

query ="insert into test.test values (%s)" 
self._cursor.executemany(query,[('4'),('3')])

Also what is the error that you are getting?

Jose Gutierrez Paliza
  • 1,373
  • 1
  • 5
  • 12