Skip to Main Content

I am trying to insert the row into table based on condition.Getting syntax error.

AshK (Oracle)Aug 25 2022

begin
for i in (select * from fusion.xla_events xe where event_id > 2400000) loop
Insert into fusion.XLA_TRANSACTION_ENTITIES
(ENTITY_ID,APPLICATION_ID,LEGAL_ENTITY_ID,
ENTITY_CODE,CREATION_DATE,CREATED_BY,
LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN,
SOURCE_ID_INT_1,SOURCE_ID_CHAR_1,SECURITY_ID_INT_1,
SECURITY_ID_INT_2,SECURITY_ID_INT_3,SECURITY_ID_CHAR_1,
SECURITY_ID_CHAR_2,SECURITY_ID_CHAR_3,SOURCE_ID_INT_2,
SOURCE_ID_CHAR_2,SOURCE_ID_INT_3,SOURCE_ID_CHAR_3,SOURCE_ID_INT_4,
SOURCE_ID_CHAR_4,TRANSACTION_NUMBER,LEDGER_ID,VALUATION_METHOD,
SOURCE_APPLICATION_ID,UPG_BATCH_ID,UPG_SOURCE_APPLICATION_ID,UPG_VALID_FLAG,OBJECT_VERSION_NUMBER) values
select
i.ENTITY_ID,APPLICATION_ID,LEGAL_ENTITY_ID,
ENTITY_CODE,CREATION_DATE,CREATED_BY,
LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN,
SOURCE_ID_INT_1,SOURCE_ID_CHAR_1,SECURITY_ID_INT_1,
SECURITY_ID_INT_2,SECURITY_ID_INT_3,SECURITY_ID_CHAR_1,
SECURITY_ID_CHAR_2,SECURITY_ID_CHAR_3,SOURCE_ID_INT_2,
SOURCE_ID_CHAR_2,SOURCE_ID_INT_3,SOURCE_ID_CHAR_3,SOURCE_ID_INT_4,
SOURCE_ID_CHAR_4,TRANSACTION_NUMBER,LEDGER_ID,VALUATION_METHOD,
SOURCE_APPLICATION_ID,UPG_BATCH_ID,UPG_SOURCE_APPLICATION_ID,UPG_VALID_FLAG,OBJECT_VERSION_NUMBER
from from XLA_TRANSACTION_ENTITIES where entity_id = 5672883;
end loop;
dbms_output.put_line('rows inserted:'||sql%rowcount);

end;

Comments
Post Details
Added on Aug 25 2022
4 comments
42 views