PDA

View Full Version : replace special characters ',",%,& in oracle 9i


farooq_rcr
07-31-2004, 01:33 AM
Hi everybody there
good morning
still i am unable to remove or replace single quotes(') ,double quotes("),and some special characters(&,% etc) from my database i.e oracle 9i,i have a table name item_master in which item_name is the field name which has thousands of records containing text like

item_name
------------
ring of 3 "
item 2 " & 3'
6%of data

now whenever my jsp page comes across such type of data it is throwing error as command not properly ended ,and even whenever i try to generate some pdf document out of these data it gives error,thats why i decided to remove all the special characters from the data base please if possible try to reply me with exact queries
thank you

afterburn
07-31-2004, 09:23 PM
then on the server I would pad the data its more that its single qoutes that are causing it..

what ever dev enviroment, verify the integrity of the query with parameters taking input from the pages. You need to replace the data before it goes into the db, no need to pad or anything coming out.

when you print the SQL query to the page it should look like this

update tbl set field = 'f'
where tbl.ProductCode = ''TEST''

do not worry about the double single qoutes it will run its an escape char just like other SQL engines. This is the default for SQL-92