Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> I'm looking for a special kind of decode
Hello, I'm running Oracle 8.1.7 on Solaris. I'm trying to figure out a
way to format my result columns subject to certain constraints. For
example, I may have a result column that looks like
<response attempts="0" contentID="D1282858CCCBA05406ABA1A80F451CD4" version="2.0"><answers><answer isCorrect="false"
chosenAnswer="true"></answer><answer isCorrect="false" chosenAnswer="false"></answer><answer isCorrect="true" chosenAnswer="false"></answer><answer isCorrect="false" chosenAnswer="false"></answer></answers></response>
which I would like to translate to "A" because the
"chosenAnswer='true'" attribute is the first of the 4 "<answer>" tags.
However, I cannot use simple DECODEs because the strings may not always
match exactly -- the contentID will be different and the
"isCorrect='true'" occurs at different places.
How can i take the above and output "A" in a SELECT statement? Thanks, - Dave Received on Tue Jan 11 2005 - 10:40:37 CST
![]() |
![]() |