I am having a script which makes a db connection and pereform some select operation.accroding to the fetch data i am calling different functions which also perform db operations.How can i pass db connection to the functions which are being called as i donot want to make new connection
-
1-1: being more specific about the problem might helplispmachine– lispmachine2009-06-01 10:11:38 +00:00Commented Jun 1, 2009 at 10:11
-
1Not really fair to downvote, users come from all over the world. Sounds as though you need to express your data connection as a variable in your class, then you can pass it in the arguments of the methods you need to call. Not a python man myself, so I'll leav it to someone who knows.Mark Dickinson– Mark Dickinson2009-06-01 10:17:26 +00:00Commented Jun 1, 2009 at 10:17
-
1A DB connection can be passed as an argument to a function. What specific problem are you having? Please provide sample code and an error message that shows what is not working.S.Lott– S.Lott2009-06-01 10:31:52 +00:00Commented Jun 1, 2009 at 10:31
-
2@Mark Dickinson: no sample code and no error message IS a pretty good reason to downvote, IMO.S.Lott– S.Lott2009-06-01 10:32:43 +00:00Commented Jun 1, 2009 at 10:32
-
1@kender: Nice hypothesis. Hopefully, the question will be updated to include facts.S.Lott– S.Lott2009-06-01 13:01:07 +00:00Commented Jun 1, 2009 at 13:01
|
Show 1 more comment