when i am creating sequence than who to use in select query or how i will write in loop statement because i want to put thousands of records by using loop