Sequence Management
Creating a Sequence
- In the Object Browser pane, right-click Sequences under the particular schema where you want to create the sequence and select Create Sequence. The Create New Sequence dialog box is displayed.
- Provide information to create a sequence:
- Enter a name in the Sequence Name field.
Select the Case check box to retain the capitalization of the text entered in Sequence Name field. For example, if the entered sequence name is Employee, then the sequence name is created as "Employee".
- Enter the minimum value in the Minimum Value field.
- Enter the increase step value in the Increment By field.
- Enter maximum value in the Maximum Value field.
The maximum and minimum value should be between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807.
- Enter the start value of the sequence in Start Value field.
- Enter the cache information in Cache field. The cache value denotes the number of sequences stored in the memory for quick access.
- Select the Cycle field to recycle sequences after the number of sequences reaches either the maximum or minimum value.
The schema name auto-populates in the Schema field.
- Select the table from the Table drop-down list.
- Select the column from the Column drop-down list.
- Click Finish.
The status bar displays the status of the completed operation.
On the SQL Preview tab, you can view the SQL query automatically generated for the inputs provided.
Support for Sequence DDL
Data Studio allows you to display sequence DDL and export sequence DDL, including Show DDL, Export DDL, and Export DDL and Data.
In the Object Browser pane, right-click the selected table.
To check DDL statement, choose Show DDL.
To export DDL statements, choose Export DDL.
To export DDL and SELECT statements, choose Export DDL and Data
The procedure is shown in the following figure.
Only the sequence owner, system administrator, or a user who has the select permission on the sequence can perform the preceding operations.
Granting/Revoking a Privilege
- Right-click selected sequence and select Grant/Revoke. The Grant/Revoke dialog box is displayed.
- Select the objects to grant/revoke privilege from the Object Selection tab and click Next.
- Select the role from the Role drop-down list in the Privilege Selection tab. Select Grant/Revoke in the Privilege Selection tab.
- On the SQL Preview tab, you can check the automatically generated SQL query.
- Click Finish.
Dropping a Sequence
Right-click the selected sequence and select Drop Sequence. The Drop Sequence dialog box is displayed. Click Yes to drop the sequence.
Right-click the selected sequence and select Drop Sequence Cascade.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot