Skip to Main Content

APEX

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!

Ajax call returned server error ORA-00904: "LAST_UPDATE_BY": invalid identifier for Execute PL/SQL C

Ahmad WaheedMay 12 2020 — edited May 13 2020

I am getting above error when I try to run this PLSQL Code.

Second last_update_by() in the ELSE Statement seems to be causing error.

Any Fix anyone...

DECLARE

   l_si varchar(10);

   l_system varchar(25);

   l_attribute varchar(100);

   l_comment_datetime varchar(50);

   l_parse_id varchar(50) := :P10_SAVE_ID;

   l_sql varchar(4000);

   l_save_date DATE := SYSDATE;

   l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;

BEGIN

   l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE (l_parse_id, '-');

  

   -- First Item is SI

   l_si := l_vc_arr2(1);

   -- Second Item is System

   l_system := l_vc_arr2(2);

   -- Third Item is Attribute

   l_attribute := l_vc_arr2(3);

   -- Fourth Item is Comment's Datetime

   l_comment_datetime := l_vc_arr2(4);

  -- l_save_date := l_vc_arr2(4);

  

   -- Update value in master spreadsheet

   IF (l_attribute like 'SYSTEM_OF_RECORD%') THEN

         l_sql := 'UPDATE data_governance_master_fields set ' || l_attribute ||

                       '= :value, last_update_date=:DATETIME, last_update_by=:UPDATED_BY where si_no=:si_no';

           execute immediate l_sql using :P10_SAVE_TEXT, l_save_date, :APP_USER, l_si;

   ELSE

       l_sql := 'UPDATE data_governance_master set ' || l_attribute ||

                       '= :value, last_update_date=:DATETIME, last_update_by=:UPDATED_BY where system=:system and si_no=:si_no';

       execute immediate l_sql using :P10_SAVE_TEXT, l_save_date, :APP_USER, l_si, l_system;

  END IF;

  

   l_sql := 'UPDATE data_governance_master_comment set last_update_date=:DATETIME, last_update_by=:UPDATED_BY ' || ' where si_no=:si_no and system=:system and to_char(datetime,''MMDDYYYYHHMI'')=:COMMENT_DATETIME';

   execute immediate l_sql using l_save_date, :APP_USER, l_si, l_system, l_comment_datetime;

  

  

   :P10_SAVE_RETURN_DATE := TO_CHAR(l_save_date,'DD-MON-YYYY HH:MIPM');

  

END;

Comments
Post Details
Added on May 12 2020
5 comments
1,078 views