Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to replace special characters

 
vas reddy
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks once again for quick response

-vasreddy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic