473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

PL/SQL: Exceptions & Sub-programs...

AB
I have an assignment due in a database programming class and to my
horror I have no idea where to even begin with this problem!! PLEASE
HELP!!

Write a PL/SQL procedure, parse_name, which accepts a string
representing names and returns the title, the first name, and the last
name. The first name and last name returned from the procedure should
be in upper cases while the title returned should presever the orginal
case. The input name string is in one of the following two formats:

FIRST_NAME LAST_NAME TITLE
LAST_NAME, FIRST_NAME TITLE

The first format depicts that the name string starts with a person's
first name and last name with a space in between, followed by a space,
and then the title of the person. On the other hand, the second
format states that the name string starts with a person's last name,
followed by a comma and a space, and then the first name suffixed with
the title with a space before it.

The following are examples of valid name strings conforming to the
formats:

1) Jane Doe Ms.
2) Doe, Jane Ms.

Your procedure should return , and Ms. for title, JANE for first name,
and DOE for last name for the above two input strings.

Your procedure should generate exceptions if any one of the three
components of the input name string is missing. Further, a message
should be printed indicating that the input string is invalid. For
instance, the following input strings should cause an exception to be
generated and the appropriate messages printed:

1) Doe
2) Jane Doe
3) Doe, Jane

You should wrap parse_name within an anonymous PL/SQL block that
accepts the name string through SQL*Plus substitution variables, calls
parse_name with the input string, and then prints the title, the first
name, and the last name returned from the parse_name procedure. You
should print the title first, followed by the first name and then the
last name, separated by spaces.
Jul 19 '05 #1
2 3790
AB wrote:
I have an assignment due in a database programming class and to my
horror I have no idea where to even begin with this problem!! PLEASE
HELP!!


We don't do homework, we merely hint...
1) Find out if you have a valid input
(hint: should have 2 space(blocks),
surrounded by characters)
2) Find out which form is used...
(hint: comma seems an indicator)

Other hints: lookup the upper, lower, instr and substr functions.
One more: documentation is on :
http://otn.oracle.com/pls/db10g/port...mo3?selected=1
Look for the SQL Reference.
--

Regards,
Frank van Bortel

Jul 19 '05 #2

"Frank van Bortel" <fv********@netscape.net> wrote in message
news:c8**********@news1.tilbu1.nb.home.nl...
| AB wrote:
|
| > I have an assignment due in a database programming class and to my
| > horror I have no idea where to even begin with this problem!! PLEASE
| > HELP!!
|
| We don't do homework, we merely hint...
| 1) Find out if you have a valid input
| (hint: should have 2 space(blocks),
| surrounded by characters)
| 2) Find out which form is used...
| (hint: comma seems an indicator)
|
| Other hints: lookup the upper, lower, instr and substr functions.
| One more: documentation is on :
| http://otn.oracle.com/pls/db10g/port...mo3?selected=1
| Look for the SQL Reference.
| --
|
| Regards,
| Frank van Bortel
|

SQL Reference for functions (upper, etc)
PL/SQL Reference for programming constructs (declarations, loops, case, etc)

-- mcs
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: William F. O'Neill | last post by:
Am using Powerbuilder 8.0.4 and SQL Server 2000. Have just installed Windows XP SP2, and can no longer connect to my SQL Server db. Someone suggested that I need to reset the port for the db at...
2
by: thechaosengine | last post by:
Hi everyone, Is there anyway to create some sort of catch-all in windows forms applications that could ensure that no unexpected exceptions bring down an application? For example, perhaps...
1
by: news.microsoft.com | last post by:
Is there an elegant way to clear out the ADO connection pool used by the SQL Server State Service following a cluster failover? We are using a SQL Cluster to store both the ASP Session State...
2
by: Manish Naik | last post by:
Hi, Using ASP.Net, I want to store and retrive documents (Word, excel, etc) from SQL Server 2000 database. I have tried image type data field, but could not succed. Can any one help me please. ...
3
by: Terry Olsen | last post by:
I've got 2 different web pages, both updating the same SQL database. One is for the Technician and one is for the Manager. The technician's update page works fine but the Manager's update page...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
2
by: Chris Moore | last post by:
I am new to .NET & SQL Server and am having fits trying to connect to a SQL Server Database/table. Can someone please please please send me a copy of their connection process (connection,...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
3
by: Bobby | last post by:
Hi, I have an application which uses Access 2003 as both the FE and the BE. However, for a number of good reasons, I am in the process of converting the BE to SQL server 2003. I am not converting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.