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!

Looping through the columns of a table in trigger

1016450Aug 28 2013 — edited Aug 28 2013

Hi ...I am trying to compare column changes in a table...The logic is :new.column1 <> :old.column1 and so on...since i have many columns in teh table i decided to use loop


Loop
select column_name into l_col from   user_tab_columns  where  table_name='X' and column_id=l_cnt1;

--where  l_cnt1 keeps increasing in the loop

IF :new.l_col <> :old.l_col

......

But it doesnt get compiled with error -"

  • PLS-00049: bad bind variable 'NEW.L_COL' "

Please suggest a way out.Thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2013
Added on Aug 28 2013
12 comments
1,449 views