sql - extracting text from a column using regexp_substr -


i have table varchar column data this:

"<tasa>   <parametros>     <parametro>       <nombre>ea</nombre>       <valor>35</valor>     </parametro>   </parametros>   <valortasa>3.15</valortasa> </tasa>" 

i need able extract value between valortasa tags, don't know how use function , can't access oracle documentation.

i'm trying

select regexp_substr(field, '<valortasa>[0-9]{0-3}</valortasa') dual; 

with no results. appreciated

more simple way using extractvalue function extract value of node.

-- sample of data sql> t1(col) as(   2    select '<tasa>   3              <parametros>   4                <parametro>   5                  <nombre>ea</nombre>   6                  <valor>35</valor>   7                </parametro>   8             </parametros>   9             <valortasa>3.15</valortasa>  10           </tasa>'  11      dual  12  )  13  select extractvalue(xmltype(col), '/tasa/valortasa') res  14    t1  15  /  res ------- 3.15 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -