Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> I'm looking for a special kind of decode

I'm looking for a special kind of decode

From: <laredotornado_at_zipmail.com>
Date: 11 Jan 2005 08:40:37 -0800
Message-ID: <1105461637.324389.239470@z14g2000cwz.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US