Exforsys

Online Training

Please solve the follwing problems

This is a discussion on Please solve the follwing problems within the Oracle Database forums, part of the Database category; select strreplace('This is a beautiful day!', 'beautiful', 'horrible') from dual The given query selects the string 'This is a ...


Go Back   Exforsys > Database > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-02-2006, 07:18 AM
Junior Member
 
Join Date: May 2005
Posts: 3
purnarao80 is on a distinguished road
Please solve the follwing problems

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.



There is table itemfile.

ITEMCODE VARCHAR2(7)
ITEMDESC VARCHAR2(6)

Write three queries:

* Select Rows, which have only numbers in ITEMCODE field.

* Select Rows, which have only chars in ITEMCODE field.

* Select Rows, which have only chars & numbers both in ITEMCODE field.
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, 09:35 AM
Junior Member
 
Join Date: Nov 2006
Location: Bangalore, India
Posts: 12
sarunraj is on a distinguished road
Send a message via AIM to sarunraj Send a message via Yahoo to sarunraj
hi strreplace()

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;

hope this helps,
RaJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-30-2006, 06:06 PM
Senior Member
 
Join Date: Nov 2004
Posts: 175
sanereddy is an unknown quantity at this point
good one
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools

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

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


Similar Threads

Thread Thread Starter Forum Replies Last Post
problems using php mail function falco85 PHP 6 04-06-2008 12:25 PM
PHP configuration problems pklad PHP 1 08-02-2006 06:19 PM
problems while configuring informatica repository server coolbee_chinna Dataware Housing Tools 2 06-24-2006 03:48 AM
Potential problems handling databases? sasha SQL Server 4 06-15-2006 12:49 PM
Oracle 8i Installation Problems siree Oracle Tutorials 5 07-19-2004 09:18 PM


All times are GMT -4. The time now is 12:25 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.