Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

When xmltype is null & I extract xmltype when it will be not null,no rows

450482Feb 25 2008 — edited Mar 26 2008
Hello
I am using xmlsequence as follows to extract values from an xmltype column. However when that column has null, I get no rows back. I thought I should be getting null back. When it is not null, I get the rows back using my xmlsequence. My query looks like:



select
extractValue(k.column_value,'c/@set') as c_name,
k.column_value.extract('c/L/key@id').getstringval()) ||' '||
k.column_value.extract('c/op/text()').getstringval() || ' '||
k.column_value.extract('c/R/val/text()').getstringval()
from table1 t1, table(xmlsequence(t1.xmlcol.extract('//c'))) k


I am not sure in this case what is the expected behavior?






Found an example:
select extractValue
(v.department, ‘/Department/DeptInfo/DepartName'),
extractValue(value(v2), '/Employee/EmpName')
from dept_xmlview v,table(XMLSequence(Extract
(v.department, '/Department/Employee')))

v2

What if the xmltype column itself is null? Then in the output I expect a row returned with null or I shouldnt be getting any rows at all?



Message was edited by:
M@$$@cHu$eTt$
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2008
Added on Feb 25 2008
9 comments
5,673 views