Solved

Using ampersand , “&” in plsql as a character

  • 14 November 2021
  • 9 replies
  • 2406 views

Userlevel 2
Badge +2

Hi,

I want to write a plsql script for a quick report with using ampersand symbol, “&”, as a character in the where clause in the code. But when run the report it gives me the error “Invalid member name.”  How can I solve  it? 

Thanks You

 

icon

Best answer by Charith Epitawatta 15 November 2021, 10:07

View original

This topic has been closed for comments

9 replies

Userlevel 7
Badge +19

@XitThariK : Do you have any comments added in the query? Incase, if you have such, you could remove and give a try to run the QR again. 

Userlevel 6
Badge +12

Hi,

I want to write a plsql script for a quick report with using ampersand symbol, “&”, as a character in the where clause in the code. But when run the report it gives me the error “Invalid member name.”  How can I solve  it? 

Thanks You

 

 

I believe you can use concatenation, as outlined here:

https://community.oracle.com/tech/developers/discussion/468604/escaping-ampersand-in-queries

 

Good luck!

Joe Kaufman

Userlevel 2
Badge +2

I tried the both but didn’t solved it.

Userlevel 7
Badge +19

@XitThariK : What is the IFS application track you use?

 

Userlevel 3
Badge +6

Hi, 

 

You could use this  replace('Test&Test','&','And')  = ‘TestAndTest’. 

 

Thanks 

L P Reddy 

Userlevel 7
Badge +31

Hi @XitThariK,

If what you have is something similar to this:

WHERE name = 'Dungeons & Dragons' 

You can replace it using the ASCII code for ampersand ‘chr(38)’ like this:

WHERE name = 'Dungeons ' || chr(38) || ' Dragons' 

I tested this and it worked. 

Hope this helps!

Userlevel 2
Badge +2

Hi Charith Epitawatta,

 

Thank You Very much. It get worked. 

 

 

Userlevel 2
Badge +2

Thanks you  everyone 

Userlevel 7
Badge +19

Hi @XitThariK ,

@Charith Epitawatta ‘s suggestion will work for you undoubtedly.  

Additiionally I would like to provide a small input from my side.. This is using LIKE clause..  

  • PL SQL Query

 
Quick report

select * from customer_info_tab
where name like 'Deals _ Done Limited'