on ‎2009 Mar 25 8:46 PM
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!
Request clarification before answering.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.