Hi
I need some help. Given a table "mytable" whose primary key is "myid" and a sequence assigned to this field for table "mytable_seq", If MAX(myid) is 100 and mytable_seq.currval is 50, I want to reset the value of mytable_seq to be 100...so that the next time a mytable_seq.nextval is called, it will be 101 (increment by 1 each time)...and not 51. Since this scenario is also happening on other tables as well, I wanted to have this as a procedure that perhaps will take as parameters the tablename, seqname and table field that will use the sequence (most often the primarykey of the table).
Thanks in advance,
yorge
I need some help. Given a table "mytable" whose primary key is "myid" and a sequence assigned to this field for table "mytable_seq", If MAX(myid) is 100 and mytable_seq.currval is 50, I want to reset the value of mytable_seq to be 100...so that the next time a mytable_seq.nextval is called, it will be 101 (increment by 1 each time)...and not 51. Since this scenario is also happening on other tables as well, I wanted to have this as a procedure that perhaps will take as parameters the tablename, seqname and table field that will use the sequence (most often the primarykey of the table).
Thanks in advance,
yorge