Solved

Custom Event and special characters

  • 6 March 2024
  • 2 replies
  • 42 views

Userlevel 3
Badge +8

Hello Everybody,

In a Custom Event, the content of a variable is automatically filled by the system. This means that, if in a variable there is a single quote, the Action fails.

For example an Event that is fired when the master part is modified and it requires the description.

 

DECLARE
  description_  VARCHAR2(32000) := '&NEW:DESCRIPTION';
  ...

BEGIN

  ...

 

If the description is something like “This is the ‘description’”, the Action fails with an SQL sintax error.

Is it possible to prevent such error ?

icon

Best answer by Charith Epitawatta 7 March 2024, 01:12

View original

2 replies

Userlevel 7
Badge +31

Hi @luca.puccini,

Instead of using single quotes, please try declaring the variable as below

DECLARE
  description_  VARCHAR2(32000) := q'[&NEW:DESCRIPTION]';
BEGIN

Hope this helps!

  

Userlevel 3
Badge +8

Thanks Charith, it works perfectly !!

Reply