Skip to main content

Hello,

when submitting in background an SQL command fired by an Event by using the Transaction_SYS.Deferred_Call, the Event is something like the following:

DECLARE
  attr_         VARCHAR2(32000);
  sql_msg_      VARCHAR2(32000);
  mySQLcommand_ VARCHAR2(32000);

BEGIN
  mySQLcommand_ := '
DECLARE
  description_ VARCHAR2(32000) := ''&OLD:DESCRIPTION'';
BEGIN
  some commands ...
END;';
  
  sql_msg_ := Message_SYS.Construct('SQL_COMMAND');
  Message_SYS.Add_Attribute(sql_msg_, 'SQL', stmt_);

  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',
    mySQLcommand_,
    'Description ...');

END;

If in the &OLD:DESCRIPTION there is a single quote, the Event is generating an error because the script is broken.

How could this be solved ?

Thanks to anyone that can help.

Be the first to reply!

Reply