Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

select the value and increase one on next insert on trigger

HjavaFeb 25 2014 — edited Feb 28 2014

select item_id from table A where stu_id="12345',  and item_id is a integer,

I want to do item_id=item_id +1 on my next insert

the following code in my trigger is not working

DECLARE

app_item_no integer := 0;

BEGIN

select TO_NUMBER(item_id)

      into app_item_no

   from A where stu_id=:Old.stu_id;

TO_NUMBER(app_item_no)=TO_NUMBER(app_item_no)+1;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2014
Added on Feb 25 2014
18 comments
3,283 views