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
64 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
1,898 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,380 points
73 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,520 points
197 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,342 views
0 votes
0 answers
+4 votes
6 answers
0 votes
2 answers

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

for write, read,append data in file check ...READ MORE

answered Jun 21 in Python by sahil
• 540 points
151 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,850 points
9,189 views