No, absolutely not..
A toothache generally means the cavity has been present and growing so long it has broken through into the nerve at the centre of the tooth.
That's serious - pain, infections, loss of the tooth or nerve etc.
If the cavity is found, cleaned of infection and filled early enough on, the nerve and the rest of the tooth are never affected.
The whole process can be fairly quick and painless as the work is only in the nerveless surface part of the tooth.
That's why you need to have a checkup annually, or even twice a year if you are prone to cavities.