-
In a table such as:
COMPANY CONTACT
--------- ---------
M & M Mickey
Jill & Co. Kate
D & G Thandi
XY and Z Alpheus
How do I return only the contacts
who work for companies with an '&'
in their names?
success?
ntokozo
-
Uses the ASCII value
Hello,
This should do the trick
select contact
from tablename
where company like '%'||chr(38)||'%';
Kind regards,
SLAM
-
Slammin'!
Great idea. It worked perfectly!
I also had suggestions to use 'set define off'
in sqlplus. Replacing with ascii equiv. would
avoid setting up the DBI to execute commands.
Just how would I do that? (is it easy to do?)
success?
ntokozo
-
You can do the following if you don't want to use the ascii values.
SQL> set scan off
SQL> select contact from tablename
where company like '%&%';
.
.
.
SQL> set scan on
Remember to set the scan back to on, as if you are trying to accept values using the & and if the scan is off, the value won't be prompted for.
- Mayur.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|