How to get xml attribute with plsql?
15,511
select x.col1.extract('//car/@model').getStringVal() from xtest01 x;
Comments
-
avj almost 2 years
create table xtest01(col1 xmltype); insert into xtest01 values ('<car><model>Audi TT</model></car>'); insert into xtest01 values ('<car model="BMW X5"/>');
-- I know how to get Audi TT:
select x.col1.extract('//car/model/text()').getStringVal() from xtest01 x;
-- But how to get BMW X5?
-
avj almost 13 yearsthanks! (this is the answer; I can accept it after some minutes, as pop-up says to me)