Toad World® Forums

Problem with Parsing Name & Address, please help

I intend to write procedures/functions in PL/SQL to [b]parse Name[/b] field into various fields : Title, FirstName, MiddleName, LastName, Gender
E.g:
Nguyen Van A
Nguyen Thi B

After parsing, the result will be shown as:

Title FirstName MiddleName LastName Gender
Mr Nguyen Van A Male
Ms Nguyen Thi B Female
http://toadfororacle.com/servlet/JiveServlet/download/20107/Parsed.gif
I supposed that Title & Gender are realized through MiddleName field. If MiddleName’s values in (Thi, Dieu) then Title is assigned as Ms, and Gender = “F”. Otherwise, Title = “Mr”, and Gender = “M”.

2/ Another procedure/function is [b]ParseAddress[/b] with the requirement as:
Address field is divided into Street, Group, Area, Ward, County fields
E.g.:
No 6 Sum Street - Group 8 - Area 2 - ABCD Ward - London

The result:

Street Group Area Ward County
No 6 Sum Street Group 8 Area 2 ABCD London

I have tried coding by Visual Basic, it is OK. But if I interpret to PL/SQL -> it doesn’t work. Please give me insructions. Thank you very much for your support!
Kind regards!

Parsed.gif