oracle - I am incrementing the value and update it to the table -


create or replace trigger trans_s_t5 after insert on trans_s each row begin update :old.no_of_books set book_no=:old.no_of_books+1 book_no=:trans_s.book_no; end; 

getting error as:

pls-00049: bad bind variable 'old.no_of_books' compilation failed, line 3 pls-00049: bad bind variable 'old.no_of_books' compilation failed, line 4 pls-00049: bad bind variable 'trans_s.book_no' compilation failed, line 2  pl/sql: ora-00903: invalid table name compilation failed, line 2 (10:11:17) pl/sql: sql statement ignored  

it appears you're trying change value of field in trans_s table in trigger, defined on trans_s table. if so, can changing trigger before trigger , updating field directly, in:

create or replace trigger trans_s_t5   before insert on trans_s   each row begin   :new.no_of_books := :new.no_of_books + 1; end; 

best of luck.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -