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

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.