Home » SQL & PL/SQL » SQL & PL/SQL » The ' Char in Oracle
The ' Char in Oracle [message #36169] Thu, 08 November 2001 08:16 Go to next message
Niraj Patel
Messages: 1
Registered: November 2001
Junior Member
I am using a HTML form which is linked up to a Oracle DB. In some of the fields they have to write a short description of themselves. The people filling out the form ofen need to put the following character in there description;

'

They use words like; don't ,etc.

Although Oracle doesnt accept this (ORA-00917 missing comma, error given). Anyone got any ideas as to how I can sort this problem out. I need to let users use that char o/w I'd be a pretty bad web designer.

----------------------------------------------------------------------
Re: The ' Char in Oracle [message #36171 is a reply to message #36169] Thu, 08 November 2001 08:30 Go to previous messageGo to next message
Shilpa
Messages: 59
Registered: November 2001
Member
One way to solve this problem is on the POST CHANGE trigger just replace the single quote with an apostrophe. When you save this into a database you will be saving an apostrophe not a single quote.

example:
-- TO REPLACE SINGLE QUOTE WITH AN APOSTROPHE
:emp.ename := REPLACE(:emp.ename,'''','`');

----------------------------------------------------------------------
Re: The ' Char in Oracle [message #36796 is a reply to message #36169] Fri, 21 December 2001 01:03 Go to previous message
akshay
Messages: 12
Registered: December 2001
Junior Member
just preprocess programmatically the query before executing it .. do as this
for any value of any column if u have the value containing ' replace it with 2 single quotes ''
this will work for sure

----------------------------------------------------------------------
Previous Topic: How can i pass the number of users who are connected in the database
Next Topic: Error in Trigger
Goto Forum:
  


Current Time: Fri Aug 14 15:42:01 CDT 2020