ORACLE11G steps and issues to create an ID self-growth listener

Source: Internet
Author: User

First, we'll build a test table by Sql/plus.

SQL statements:

Cteate TABLE TEST (

ID number,

NAME VARCHAR2 (20),

PRIMARY KEY (ID)

);

Create a sequence by sql/plus

SQL statements:

CREATE SEQUENCE Seq_test

INCREMENT by 1

START with 1

MINVALUE 1

MAXVALUE 9999

Nocycle;

Attention:

1.INCREMENT by: Sets the difference between adjacent two elements, that is, the step size, the default value is 1;

START with: Sets the initial value of the sequence, the default value is 1;

MAXVALUE: Sets the maximum value of the sequence;

MINVALUE: Sets the minimum value of the sequence;

Nocycle: Specifies that the generated value is not looped when the sequence reaches its maximum or minimum value.

2. The sequence has the following two properties

Currval: Returns the current value of the sequence;

Nextval: Returns the value of the current sequence value increment by one step.

You can use the Currval property only after you have issued at least one nextval.

I. Establishing a trigger trigger_test via PL/SQL developer

The steps are as follows:

trigger--Trigger

Right-click Triggers, which appears:

When you click New, it appears:

OK to appear later:

The statement in the red box was later played by itself.

After you lose the above content, click the button in the Red box to:

Two. Create a trigger trigger_test from the Sql/plus statement:

Problems encountered:

End Trigger;

or SQL line edit mode, how to exit Ah,

And this method trigger has not been built successfully. Ask for advice.

Thank you @ Back Tower:

method is input/return

The above content I have already practiced, such as reprint please indicate the source, thank you.

ORACLE11G steps and issues to create an ID self-growth listener

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.