11-07-2007 2:09 AM
Hi all...
i gt this sql statement.
select firstname from student where admino = '123'.
i want to extract a word after the word from which is <b>student</b>.
how can i do it?
thks
11-07-2007 2:29 AM
select firstname
from student
where admino = '123'
and firstname = 'Student'.
Minal Nampalliwar
11-07-2007 2:35 AM
think gt me wrong....
let me rephrase my sentence.
exmaple.
i have a good friend name ken.
i want to extract a word after 'good'.
The extract word i want is <b>friend</b>.
how can i do it?
11-07-2007 2:36 AM
> select firstname from student where admino = '123'.
do it like this
select <fields> from STUDENT into table IT_STUD where ADMINO = '123'.
loop at IT_STUD.
move IT_STUD-FIRSTNAME+7(13) to IT_FINAL-FIRSTNAME.
move fields to IT_FINAL-fields. " respectvie fields
append IT_FINAL.
endloop.
supposing that the firstname length is 20
<b>OK, from your latest post which you just happened to post. I under stand like this and see the reply.</b>
loop at IT_STUD.
split IT_STUD-FIRSTNAME at SPACE into t1 t2 t3 t4. "I AM GOPI NARENDRA
" now t1 contains I
" t2 contains AM
" t3 contains GOPI
" t4 contains NARENDRA
move fields to IT_FINAL-fields. " respectvie fields
append IT_FINAL.
endloop.
Regards
Gopi
Message was edited by:
Gopi Narendra
11-07-2007 2:48 AM
think u misunderstand from the previous entry pls look at the latest entry.
Anyway thks for helping.
i want to extract a word out from a sentence. The word i want to extract out is after this word 'good'. I expecting <b>friend</b> to be the extracted value. How can i do it?
the sentence is: i have a good friend name ken.
11-07-2007 2:58 AM
DATA: names(30) TYPE c VALUE 'i have a good friend name gary',
one(10) TYPE c,
two(10) TYPE c,
three(10) TYPE c,
four(10) TYPE c,
five(10) TYPE c,
six(10) TYPE c,
seven(10) TYPE c.
SPLIT names AT space INTO one two three four five six seven.
WRITE : / one.
WRITE : / two.
WRITE : / three.
WRITE : / four.
WRITE : / five.
WRITE : / six.
WRITE : / seven.
Here FIVE give the value 'FRIEND'.
Hope this is what you want.
Regards
Gopi
11-07-2007 3:08 AM
yes! you have answer my question partially.
i just like to retrieve the value out after the word <b>good.</b>
example 1: i have a <b>good</b> friend name gary
friend is the value i want to retrieve.
example 2: i have a <b>good</b> habit that is hardworking.
habit is the value i want to retrieve.
any idea
11-07-2007 3:14 AM
Its the same SPLIT command which can do this.
Use the SPLIT command for the same sentence "i have a good habit that is hardworking" now use the SPLIT command at space into 1 2 3 4 5 6 7 8 9 .... and so on
5 will contain the HABIT.
Regards
Gopi
11-07-2007 3:41 AM
try this
data : text(70) value 'i have a good friend name gary' .
data : text1(20),text2(20),text3(40).
clear : text1,text2,text3.
split text at 'good' into text1 text3.
clear : text1,text2.
condense text3.
split text3 at space into text2 text1.
write : / text2.
regards
shiba dutta
11-07-2007 3:45 AM