How can you use a single insert statement into three tables from three different classes in python

0 votes
How can you use a single insert statement into three tables from three different classes in python. I have only one method. Using that method we can call from class A, B, and C.
May 23, 2019 in Python by Kashish
630 views

1 answer to this question.

0 votes

you can use executescript() method :

This is a convenience method for executing multiple SQL statements at once. It executes the SQL script it gets as a parameter.

Syntax:

sqlite3.connect.executescript(script)
answered May 23, 2019 by Mihir

Related Questions In Python

0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
3,458 views
0 votes
1 answer

How can I turn an input date into a readable string in Python?

The datetime class has a method strftime. strftime() ...READ MORE

answered Dec 11, 2018 in Python by aryya
• 7,460 points
714 views
0 votes
1 answer

How can I read numbers in Python from a custom file?

Hi, good question. Let us first assume that ...READ MORE

answered Feb 6, 2019 in Python by Nymeria
• 3,560 points
1,130 views
0 votes
1 answer
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,071 views
0 votes
1 answer

How do you read from a file using file handling in python?

To read from a file you can ...READ MORE

answered Jul 30, 2019 in Python by Mohammad
• 3,230 points
1,175 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,890 points
20,009 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP