0

Please I have a PL/SQL package where I'm using HTML code.

In the HTML code I need to use the euro symbol (as its HTML code) but when I use € the PL/SQL package considers like if i want to pass him a variable and he keep asking me about the value of euro.

Is there any option that makes the use of € possible in a PL/SQL package?

phrase_conditionnelle := 'Le montant de '||mt_salaire||
                                         ' €</b> ;
Alex Poole
  • 183,384
  • 11
  • 179
  • 318
sr123
  • 85
  • 1
  • 11
  • you can check this link [link]https://stackoverflow.com/questions/2717686/add-currency-sign-%C2%A3-to-certain-fields-oracle – Ahamed May 09 '19 at 08:27
  • The line of code you posted used the actual euro symbol, not the HTML encoding; and it is missing a closing quote. Please show exactly what you are doing. – Alex Poole May 09 '19 at 08:35
  • Possible duplicate of [Add Currency Sign £, $ to certain fields ORACLE](https://stackoverflow.com/questions/2717686/add-currency-sign-%c2%a3-to-certain-fields-oracle) – ikramf90 May 09 '19 at 08:37
  • This is specifically about handling the encoded form `€`, not the actual euro symbol character - though that wasn't clear from the question's original formatting. So that suggested duplicate doesn't actually seem to be relevant. – Alex Poole May 09 '19 at 08:57

2 Answers2

2

It looks like your client is interpreting the &euro; as a substitution variable:

SQL> select '&euro;' from dual;
Enter value for euro:

You can disable that behaviour with set define off in SQL*Plus, SQL Developer or SQLcl:

SQL> set define off
SQL> select '&euro;' from dual;

'&EURO
------
&euro;

1 row selected.

SQL> set define on; -- optional but restores behaviour

This is nothing to do with PL/SQL really, or even SQL; it's just client behaviour, at the point you try to compile the package - the client is interpreting the & before it passes any code to the database for processing. That also means that sessions calling your package don't need to worry about that setting.

Alex Poole
  • 183,384
  • 11
  • 179
  • 318
0

this is one of the possible way to do that. just replace & by chr(38)

phrase_conditionnelle := 'Le montant de '||mt_salaire|| chr(38)||'euro;' ;
hotfix
  • 3,376
  • 20
  • 36