What do I do when my phone says “database corrupted”?

I have a Nokia 5800.
I tried to open the notes application on my phone, but a message appeared saying "database corrupted.
Some date might have been lost".
How did this happen?
How do I get my notes to work again?
