cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Invalid Relational Operator

Former Member
0 Likes
1,205

Hi All,

In my query, I'm trying to set up my Free-Hand SQL query to accept a prompt and either check the column against the values in the prompt, or if the prompt is equal to XXXX just display all:

select *

from invoice

where company_code in @prompt('Enter Company Code(s) separated by a semicolon or XXXX:', 'a', {' '}, multi, free) or @prompt(''Enter Company Code(s) separated by a semicolon or XXXX:', 'a', {' '}, multi, free) = 'XXXX'

When I pass a single company code, or XXXX the query executes fine. When i enter multiple company code values, I get the error message:

Exception: DBD, ORA-00920: invalid relational operator

State: N/A

and the really odd thing is if i remove everything after the OR - the query will accept mulitple or single codes with no issue.

Any advice?

Thanks!

View Entire Topic
Former Member
0 Likes

Thanks for your help! Although i did have to make one minor change. I had to switch the order of the XXXX portion of the where statement to ...

'XXXX' IN @prompt......

Thanks again!