Home » RDBMS Server » Server Administration » replace single quote
replace single quote [message #371572] Thu, 09 November 2000 00:54 Go to next message
Srinivas
Messages: 138
Registered: June 2000
Senior Member
I want to print srinu's from dual
i applied all replace commands
i did 'nt get result
please tell me the proper statement with example
thank u
srinivasu
Anion Technologies
Hyderabad
India
Re: replace single quote [message #371574 is a reply to message #371572] Thu, 09 November 2000 04:45 Go to previous message
Babu Paul
Messages: 38
Registered: November 2000
Member
Hi Srini!
There are two ways of doing it. One method is to set the escape on and executing the following query.

SET ESCAPE ON
(default is \)

now try
SELECT 'srinu'\'s' FROM dual;

The output should be as expected.

The second method is to execute the following query without changing SQL environment.

SELECT 'srinu' || CHR(39) || 's' FROM dual ;

Good Luck!
Babu
Previous Topic: repeating values
Next Topic: Implict date conversion
Goto Forum:
  


Current Time: Sat May 04 18:05:08 CDT 2024