this is the portion of the code where I had used mycursor variable please see: there are two modules where i had used this variable - First in creating and writing sql query