My requirement is given below.
In my application one LOV is there to show Insured names.In that if we query for the name like ahemd's% then it is showing wrong(junk) data..................So,my question is how to add single quote to already existing single quote.........................I tried in many ways but I didn't get any solutions for this...............even I used Q'[]' frunction but no use.................................One more thing,we need to query for that name dynamically means.............
select '&name' from dual;
where '&name' -- you can pass as ahemd's..................but once you give this you will get a eror message like
"ORA-01756: quoted string not properly terminated".please send me solution..........................
How can I use Replace function?
I am passing the sting dynamically..............
ex: SELECT REPLACE('&NAME',''',''''') FROM DUAL;
if you run this statement,it will ask the name
then you just enter adem's.....
If you execute that statement you will get
"ORA-01756: quoted string not properly terminated" error..........
please suggest me, is there any way to handle.................
I am trying to solve a similar issue. We need to find all the names that have an apostrophe in it. I tried the code below, but I get the error below the code. Help?
use enterprise
SELECT REPLACE('&fldName_Last','''','') FROM locStaff
where fldName_Last like "'%"
Msg 207, Level 16, State 1, Line 4
Invalid column name ''%'.
I don't think you are still looking for this answer.But I thought I would post answer so that it would be helpful who are following this thread.
assuming that you are trying to eliminate single quote.
SELECT REPLACE('&NAME','''','') FROM DUAL
pass 2 singlequotes in the parameter for adem's
ex:adem''s
would return adems
OR
from the given table
SELECT REPLACE(col1,'''','') FROM TEMP
where col1='adem''s'