0

sys_guid() function generating as big as 32 digits of unique id. But i need to generate uniqu id of length less than 10. Is there any way?

Prasanna B R
  • 489
  • 2
  • 6
  • 12
  • 2
    Use a sequence to generate unique numbers –  Mar 26 '14 at 14:15
  • CREATE SEQUENCE sq_test START WITH 1000000000; then use sq_test.nextval, then you get 1000000001, 1000000002 until 9999999999 – DARK_A Mar 26 '14 at 16:31
  • @DARK_A - Thanks for your support. I need to generate this sequence per day basis. That is this sequence should reset everyday, and start from the initial value every day. Is that any easy way? – Prasanna B R Mar 26 '14 at 17:44
  • You can create a procedure to drop sequence and create it again with start 1000000000 and run it daily. Then you can reset counter daily. Try reading for runing procedure daily: http://stackoverflow.com/questions/13642745/how-to-call-the-stored-procedure-in-oracle-with-the-daily-scheduled-jobs . – DARK_A Apr 18 '14 at 10:12

0 Answers0