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 in Python by Kashish
33 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 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
848 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 ariaholic
• 7,340 points
44 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 in Python by Nymeria
• 3,520 points
87 views
+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 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 405 views
+4 votes
6 answers
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 in Python by Mohammad
• 3,170 points
48 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,810 points
243 views