There are many dept record in my db and each dept may have one or more than one record.
I am trying to fetch one dept and then to get this dept records that may be one or many. Please check this link that shows the wrong output whereas the expected output is at this Link
Since you are reusing the variable "m2" for both the departments, it is retaining the values of the first department and carried to the second department. Try to reinitialize the variable m2 after the iteration of the first department is over.
Joined: Mar 22, 2008
Thanks a lot. The problem fixed with initializing msg2 within while loop