Yes, a1ex07 is right. To find out which sequence is related to which table, you have to check the database design which was created by the developers. But there might be an option. Check if the tables have triggers which populate the sequence controlled columns. In the previous example, the database server inserts an incremented value (or the first value of the sequence, which is 1) into the col1 and col2 columns of the table. You can use NEXTVAL (or CURRVAL) in the SET clause of the UPDATE statement, as the following example shows: UPDATE tab1 SET col2 = seq_2.NEXTVAL WHERE col1 = 1.
![]() ![]()
Semantics The keywords and parameters in this statement serve the same purposes they serve when you create a sequence. To restart the sequence at a different number, you must drop and re-create it. If you change the INCREMENT BY value before the first invocation of NEXTVAL, then some sequence numbers will be skipped. Therefore, if you want to retain the original START WITH value, you must drop the sequence and re-create it with the original START WITH value and the new INCREMENT BY value. If you alter the sequence by specifying the KEEP or NOKEEP clause between runtime and failover of a request, then the original value of NEXTVAL is not retained during replay for Application Continuity for that request. Oracle Database performs some validations. For example, a new MAXVALUE cannot be imposed that is less than the current sequence number.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |