I am using the following code in an event but the deferred job is erroring:
Declare
Attr_ Varchar2(32000);
Sql_Msg_ Varchar2(32000);
Block_ Varchar2(32000);
TRANSLATION_TEXT_ varchar2(2000);
Begin
Block_ :=
'
Declare
info_ varchar2(200) := null;
title_ varchar2(50);
Begin
select title into title_ from doc_issue_reference where doc_no=''&NEW:DOC_NO'';
If title_ = ''Delivery Note No'' Then
Begin
ifsapp.doc_issue_api.New_Revision2__(''&NEW:DOC_CLASS'',''&NEW:DOC_NO'',''&NEW:DOC_SHEET'',''2'',''&NEW:DOC_SHEET'',''TEST'',1,1,1,''DELI'');
End;
Endif ;
End ;
'
;
--Transaction_Sys.Is_Session_Deferred;
Sql_Msg_ := Message_Sys.Construct('UPDATECOLINE');
Message_Sys.Add_Attribute(Sql_Msg_, 'SQL', Block_);
Client_Sys.Clear_Attr(Attr_);
Client_Sys.Add_To_Attr('SQL_DATA_', Sql_Msg_, Attr_);
Client_Sys.Add_To_Attr('MSG_', '', Attr_);
Transaction_Sys.Deferred_Call(
'Fnd_Event_Action_API.Action_Executeonlinesql',
'PARAMETER',
Attr_,
Language_Sys.Translate_Constant('Event', 'Delivery Note Revision', Null, '')
);
End;
Background job error:
ORA-06550: line 16, column 5:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
if
ORA-06512: at "IFSAPP.TRANSACTION_SYS", line 2025
ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2314
ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2310
ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2319
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_SQL", line 1721
ORA-06512: at "IFSAPP.TRANSACTION_SYS", line 2015
ORA-06512: at "IFSAPP.TRANSACTION_SYS", line 282
ORA-06512: at "IFSAPP.TRANSACTION_SYS", line 2025
ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2314
ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2310
ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2319
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_SQL", line 1721
ORA-06512: at "IFSAPP.TRANSACTION_SYS", line 2015
ORA-06512: at "IFSAPP.TRANSACTION_SYS", line 282
ORA-06512: at "IFSAPP.TRANSACTION_SYS", line 857
Any help would be much appreciated