R
R
r4khic2019-10-02 13:07:56
Python
r4khic, 2019-10-02 13:07:56

How to implement the idea of ​​implementing an sql query?

There is a request like this:

self.cursor.execute('''INSERT INTO items (res_id, log_id, link, title, content, n_date, nd_date, s_date, not_date)
                       VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)''',
                       ( res_id,
                         log_id,
                         str(resource_link),
                         str(item_title),
                         str(item_content),
                         str(n_date),
                         nd_date,
                         s_date,
                         not_date
                       )
                                )

How can I make this query add news not one news at a time, but 100 news at a time?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2019-10-02
@VladimirAndreev

Look in the documentation for your library how to do batch / bulk / multiple insert...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question