Skip to main content
Question

Single quote in background Event


Forum|alt.badge.img+8

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.

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings