Just Like Mark wrote, I start with the whiteboard.
When that gets to small I make the model in Oracle SQL Developer Data Modeler [^], which supports Oracle, SQL Server and DB2 out of the box, and you can make your own design rules as well.
And as an extra plus, it supports source control via Subversion.
"The ones who care enough to do it right care too much to compromise."
If its running for 3 days, then for the first day it executes perfectly.
For the second day and remaining all days it gives following error.
Strange. Based on what you share, sounds like some logical error where you are considering the DayNo. Are you? Somehow, somewhere the current day is getting into picture while running the procedure and the error. Did you DEBUG and see? Check if so.
A primary key (often) consists out of multiple columns. I'd suggest putting the primary key on BOTH, and to add an autoincrement-field and make that unique. Use the autoincrement-column to make relations to other tables.