AllExperts > Oracle 
Search      
Oracle
Volunteer
Answers to thousands of questions
 Home · More Oracle Questions · Answer Library  · Encyclopedia ·
More Oracle Answers
Question Library

Ask a question about Oracle
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Suchitra Joshi
Expertise
I can answer questions regarding SQL, PL/SQL, Procedures, Functions, Triggers, SQL Loader, Oracle Forms, Oracle Reports, and some basic dba and performance tuning activities.

Experience
15+ years of Oracle PL/SQL Development

Education/Credentials
B.Sc (Electronics), Diploma in Computer Applications (DCA)

Awards and Honors
OCP - SQL and PL/SQL
Brainbench certifications in Oracle Administration, PL/SQL, Developer 2000

 
   

You are here:  Experts > Computing/Technology > Oracle > Oracle > sql query or cursor

Oracle - sql query or cursor


Expert: Suchitra Joshi - 9/29/2009

Question
 Fullname                TIT    NAME   MIDDLENAME surname

Mr rahul kumar shukla     Mr    rahul   kumar      shukla
Mr Chinku                 Mr    chinku
Mr rinku prasad           Mr    rinku   prasad
Mr pintu gupta            Mr    pintu              gupta
Mr chintu agrawal         Mr    chintu             agrawal
dipti kumari soni               dipti   kumari     soni
Mr kishor kumar tiwari    Mr    kishor  kumar      tiwari
Mrs asika kumar sinha     mrs   asika   kumar      sinha
mragendra                       mragendra
mah   kum    sura               mah      kum       sura

this is the table i have only one column FULLNAME. All the values containing fullname separated by space like this::

title name middlename fullname.


I want to
the split this fullname and get title, name ,middlename, surname
if any thing missing in the fullname please dont update that value in a column like this

in second row "Mr Chinku" containing only title and name thats why title and name are filled other two column middlename,surname was blanked

please give me the solution like CURSOR ,QUERY any thing

Answer
Hi Sandeep,

I did not understand your question properly. If anything is missing in fullname, do you want the query to show those values in appropriate columns and do you don't want it at all ?

eg. Mr Chinku

Should this return Title as Mr and Name as Chinku ?

eg. dipti kumari soni

Should this return Title as dipti, Name and kumari and Middlename as soni?
or Title as null, Name as dipti, Middlename as kumari and Surname as soni ? (this is not possible unless there are spaces in those particular places)

Please let me know so that I can help you further.

Regards

Suchitra

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.