lundi 11 juillet 2016

Getting min value of the sequence

I have around 100 sequences defined in the database, that are set to some number after the testing has been performed.

For example: There is a sequence: suppier_seq. That would start with 1 and now its currval is 101.

I need to reset all the sequences that exist based on their min value.

If I extract the DDL of the sequence, it comes with the present value as start with:

CREATE SEQUENCE  "RMS14"."SUPPLIER_SEQUENCE"  MINVALUE 0 MAXVALUE 99999999999 INCREMENT BY 1 START WITH 101 CACHE 100 NOORDER  NOCYCLE ;

I need to restart the sequence with the minimum value.

How can i capture the minimum value of the sequence via SQL?

Aucun commentaire:

Enregistrer un commentaire