Home » SQL & PL/SQL » SQL & PL/SQL » Text removal after space
Text removal after space [message #169] Wed, 23 January 2002 11:43 Go to next message
jjd
Messages: 1
Registered: January 2002
Junior Member
Is there a function to edit a text column and remove anything after a space?

Ex - file that produces Peter P. and I just want Peter?

Any help would be appreciated-jd
Re: Text removal after space [message #180 is a reply to message #169] Thu, 24 January 2002 04:59 Go to previous messageGo to next message
Ajay Gandhi
Messages: 14
Registered: January 2002
Junior Member
None. You will have to write a PL/SQL function to do that.

Re: Text removal after space [message #201 is a reply to message #169] Mon, 28 January 2002 01:27 Go to previous messageGo to next message
Diwakar Bhandari
Messages: 7
Registered: January 2002
Junior Member
I assume that U want only 'Peter' to be displayed while the column in the table contains 'Peter P' .
Do something like this ...(insert statement used is only for demonstration purpose)

sql>insert into emp values(7897,'Peter P','Clerk',7902,null,null,null,null );
1 row created.
sql>select substr(ename,1,instr(ename,' '))as Name from emp where empno = 7897;
NAME
----------
Peter

Hope this helps

Diwakar
Re: Text removal after space [message #207 is a reply to message #169] Mon, 28 January 2002 08:38 Go to previous message
JD
Messages: 7
Registered: March 2001
Junior Member
Thanks, it worked great.
Previous Topic: book
Next Topic: Problem with a procedure
Goto Forum:
  


Current Time: Tue Jul 07 04:40:57 CDT 2020