Delete part of text from field

P

prodeji

Hi all

Here's my challenge:

I'm processing a customer info file with your standard demographics -
first name, last name, age, address etc.

The last name appears in all of the 'last name' fields; no problem.
However, in some of the 'first name' fields the last name appears
again, like so:

F_Name L_Name Title
Kris Doft Doft Manager
Johan Smith Accountant
Maria Katson Katson Director
Anne Charles Charles Supervisor

Is there a query that can get rid of the duplicate last name in the
'first name' fields?

Obviously it can't be a standardised 'delete last 4 characters in
F_Name field' type of deal as both the first and last names will have
differing lengths in any given record.

I think I basically have to tell the database to 'delete any character
that comes after a space ' ' in the F_Name field, but I don't know how
to do that...

Um... help?
:)
Thanks
 
P

prodeji

Forgive me for doing this...

With the instruction posted here I came up with:

UPDATE TABLE_NAME SET TABLENAME.FIELDNAME1 = Left([FIELDNAME1],InStr(1,
[FIELDNAME1]," ")-1)
WHERE (((TABLENAME.FIELDNAME1) Like "* " & [FIELDNAME2]));

Can anyone help me 'transpose' this into Oracle(PL/SQL)?

I've started researching and so far I know 'Left' is replaced by
'SUBSTR' in Oracle but I'm under some serious duress timewise...

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top