Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

STRING MANIPULATION

Status
Not open for further replies.

Raul2005

Programmer
Sep 23, 2005
44
US
I have the follwing:
afsfffdfREMARKSdddddd
returned on my record and I need to detect for REMARK and replace all what I have before with empty spaces so my final result will be

REMARKSdddddd

Note: I have not control of the size of the record Remarks could be in any positions and it is warranty REMARKS will be on all records.

Thanks
 

HINT: Combine SUBSTR() and INSTR() functions:

Code:
SUBSTR(col1,INSTR(col1,'REMARKS'))

[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
I need some help to:

ID USERNAME MESSage
1 nrj hello(nrj)there is a..
2 pqt hola(nrj) today we had
3 nrj Try one more(nrj)time


I need the following resul

ID USERNAME MESSage STATUS
1 nrj hello(nrj)there SENT
2 pqt hola(nrj) today we RECEIVED
3 nrj Try one more(nrj) SENT

As you can see I need to look inside the message string for the value I have in field USERNAME Ineed to compare and if inside the message string I found a value like the USERNAME I need to display another field with tthe status set to SENT in other case it will be se to Received.

I will appreciate any help

Raul
 
Raul,

We typically do not "double post" the same question in multiple threads. I didn't see your second post of the same question until after I had already posted the following suggestion in your other thread.

Here is the code I posted in your other thread:

Code:
Select id
      ,username
      ,message
      ,decode(instr(message,username)
             ,0,'RECEIVED'
             ,'SENT'
             ) status
from my_table
order by id;

Once you decide which thread you would like to use for your responses, please "Red Flag" on set of posts or the other to avoid confusion.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top