Exforsys

Free Training

Hello

This is a discussion on Hello within the Oracle Apps forums, part of the ERP category; Pls Help me for following Problem in PL/SQL select strreplace('This is a beautiful day!', 'beautiful', 'horrible') from dual The given ...

Go Back   Exforsys > ERP > Oracle Apps

Exforsys.com

  #1 (permalink)  
Old 08-02-2006, 04:18 AM
Junior Member
 
Join Date: May 2005
Posts: 3
purnarao80 is on a distinguished road
Hello

Pls Help me for following Problem in PL/SQL

select strreplace('This is a beautiful day!', 'beautiful', 'horrible')
from dual

The given query selects the string 'This is a horrible day!'. The string 'beautiful' is replaced by 'horrible'. Write the function strreplace.


without using replace / translate function in pl/sql we have to solve above problem.could you any one help me...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-27-2006, 01:47 AM
Junior Member
 
Join Date: Nov 2006
Location: Bangalore, India
Posts: 16
sarunraj is on a distinguished road
Send a message via AIM to sarunraj Send a message via Yahoo to sarunraj
Post try this out

Hi hope that this solves ur problem..

function strreplace(parent_string varchar2(100), to_replace varchar2(50), replace_by varchar2(50)) return varchar2
as
string1 varchar2(100);
string2 varchar2(100);
final varchar2(200);
begin
string1 = substr(parent_string,1, instr(parent_string,to_replace,1,1) - 1)
string2 = substr(parent_string,length(to_replace) + instr(parent_string,to_replace,1,1), length(parent_string))
final_string = string1||replace_by||string2
return(final_string);
end;


regards,
RaJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.