Well, yes that is what I figured out but I faced one more issue that I ignored in the first place.
There is a table in which I need to insert data into. There is column of my concern that is an integer. There is unique constraint that I want to avoid violating. For that I need unique integral values.
Now what you suggested and what I am doing, will generate unique numbers but that may be there in the table where I am inserting the data.
So the question now is - How do I get a unique integer that is not there in the table's concerned column already and if it is there how to avoid the clash?