Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get around Ampersand in text field in Select statement

576981May 10 2007 — edited May 10 2007
I have an SQL statement I am trying to run in SQL*Plus. In one of my subqueries, I have a select statment in which some of the fields I am trying to pull have an "&" within the text. So, when I try and run the query it returns "Enter value for 35:". I've even tried wildcard characters and it is still not working. If anyone could help me with this, I would appreciate it. Here is a sample of my statement (the subquery is at the bottom of the statement):
select real_case.file_dt, real_case.dscr, pty_cd, first_name, last_name, addr_line1, addr_line2, city, st_cd, zip_cd
from real_case, pty, idnt, ptyaddr s1, addr
where real_case.case_id = pty.case_id 
AND pty.idnt_id = idnt.idnt_id
AND pty.case_id = s1.case_id
and pty.seq = s1.seq
and s1.addr_id = addr.addr_id
and (real_case.file_dt >= '01-NOV-06' 
and real_case.file_dt <= current_date)
and (real_case.dscr like '79D01-%'
or real_case.dscr like '79C01-%'
or real_case.dscr like '79D02-%') 
and (pty.pty_cd like 'DFNDT') 
and (s1.ins_dttm in
(select max(s2.ins_dttm) from ptyaddr s2
where s2.case_id = s1.case_id
and s2.seq = s1.seq))
and (real_case.case_id in 
(select case_id from ptychrg 
where ptychrg.actn_cd IN ('35-41-5-1&35-48-4-1')));
Thanks,
Shannon
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2007
Added on May 10 2007
5 comments
650 views