Showing posts with label Create Sequence. Show all posts
Showing posts with label Create Sequence. Show all posts

Monday, April 29, 2013

Sequence table Description and list of sequence

How to get List of  List of  SEQUENCES Created by the User  ????
--------------------------------------------------------------------------------------------
QUERY :: select * from user_sequences

Result::

DESCRIPTION::
user_Seuences is table which stores all the information all about the created sequences. like MINVAL,MAXVAL,INCREMENT_BY,CYCLE,CACHE_SIZE

MinValue :: this attribute  will define what is the minimum value of Sequence.
MaxValue:: this  attribute  will define what is the maximum value of Sequence.
INCREMENT_BY::this  attribute  will define what is the Increment value of Sequences.
Cycle_FLAG:: This attribute will define that  you want to  restart the cycle after define maximum value.
CACHE_SIZE:: this attribute will define size of cache. this will allow to define  how many value are there in Cache or  buffer ??

Saturday, April 27, 2013

Create sequence with by Different ways and parameters

Following  post will  Help  you  to create  sequence  in oracle


Create SEQUENCE  Command
-----------------------------------------
Syntax:

CREATE SEQUENCE   SEQUENCE_NAME
MINVALUE  [-100 ]   //optional   [Can be  positive or Negative]
MAXVALUE [100]    //optional    [Can be  positive or Negative]
START WITH 0        //optional     [Can be  positive or Negative]
INCREMT BY 1      //optional      [Can be  positive or Negative]

-----------------------------------------
create sequence SqEmp
minvalue 1
maxvalue 500
start with 1
increment by 2


Above Image has  Create Command for Creating Sequence like [ 1,3,5,7,9....]   because   we  Increment Sequence by  "2"  so.. Here We define minimum value  is   1.
Maximum  value is 500 [Here maximum value will be  499].
sequence will no  display index value  more  than  500.

From Above  Image  you can  see that  we can create sequence  with  different style  and  different  parameters.
In a  Image[1]  we have parameter's start with in which we define

  1.  start with (1) 
  2.  increment by (1) 

  if  we Don't  assign such parameter it by default  take (1) for that parameters.