| | |
How to handle Single Quotes in Pl/SQL?
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
hai,
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..........................
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:
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 passing the sting dynamically..............
ex:
SELECT REPLACE('&NAME',''',''''') FROM DUAL; if you run this statement,it will ask the namethen 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.................
Last edited by peter_budo; Dec 12th, 2008 at 7:09 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Sep 2009
Posts: 1
Reputation:
Solved Threads: 0
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.
pass 2 singlequotes in the parameter for adem's
ex:adem''s
would return adems
OR
from the given table
The actual data in the column reads as adem's
assuming that you are trying to eliminate single quote.
sql Syntax (Toggle Plain Text)
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
sql Syntax (Toggle Plain Text)
SELECT REPLACE(col1,'''','') FROM TEMP WHERE col1='adem''s'
The actual data in the column reads as adem's
Last edited by peter_budo; Sep 22nd, 2009 at 9:24 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- How to configure GD (PHP)
- php.ini confusion (PHP)
- Open In New Window Php (PHP)
- nested joins, from mdb. Possible? (Visual Basic 4 / 5 / 6)
Other Threads in the Oracle Forum
- Previous Thread: ip
- Next Thread: Multiple row insertion
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






