Author Topic: SELECT on a sequence and nextval  (Read 4055 times)

ssharma

  • Newbie
  • *
  • Posts: 2
    • View Profile
SELECT on a sequence and nextval
« on: September 23, 2009, 09:44:01 AM »
Is it possible to grant SELECT on a sequence to a user (readonly user), but user should not be able to increment the sequence by using nextval on that sequence?

 Because if it does so, the user is not "readonly".


cory

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: SELECT on a sequence and nextval
« Reply #1 on: January 02, 2010, 06:58:09 PM »
Would creating a view returning last_number+increment_by work for you?  The users can be granted read only access to the view.

CREATE VIEW sequences_next_number  AS
  SELECT a.sequence_name
     , a.last_number+increment_by as next_number
   FROM all_sequences a;
« Last Edit: January 03, 2010, 09:41:39 AM by Mike »