Meaningless Drivel is fun!*
The moose likes Oracle/OAS and the fly likes How to replace special characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "How to replace special characters" Watch "How to replace special characters" New topic
Author

How to replace special characters

vas reddy
Greenhorn

Joined: Jun 11, 2008
Posts: 23
Can some one help me on this..

I am trying to replace a special character in the string using replace function, but oracle waits for input value,

SELECT REPLACE('ram & sam', '&', '*') FROM DUAL.

The string is dynamic and I am using replace function in the oracle procedure

thanks
vas
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi Vas,

Where do you execute this script? In sql*plus you can use "set define off" to disable parameter passing to sql.

Regards,

Fatih.
vas reddy
Greenhorn

Joined: Jun 11, 2008
Posts: 23
Thanks Faith for your quick response.

I am executing the script in sqlplus and I tried your suggestion and its working excellent.
I have one more question, do I have to unset this (set define off) or automatically get unset after my sqlplus session closed?

thanks
vas
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
You are welcome,

You can use "set define on" to enable parameter passing in the same session, but you are right it is effective during your own session.
Each time you create a new session you have to set/unset it.

Regards,

Fatih.
vas reddy
Greenhorn

Joined: Jun 11, 2008
Posts: 23
thanks once again for quick response

-vasreddy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to replace special characters