oracle xmltype¼ò½é
ÕÒ²»µ½ÔÌûÁË ¾ÍÌùÕâÀï°É£¡
ÔÚÏò´ó¼ÒÏêϸ½éÉÜOracle֮ǰ£¬Ê×ÏÈÈôó¼ÒÁ˽âÏÂOracle xmltypeÊÇʲô£¬Oracle´Ó9i¿ªÊ¼Ö§³ÖÒ»ÖÖеÄÊý¾ÝÀàÐÍ----
xmltype£¬ÓÃÓÚ´æ´¢ºÍ¹ÜÀíxmlÊý¾Ý£¬²¢ÌṩÁ˺ܶàµÄfunctions£¬ÓÃÀ´Ö±½Ó¶ÁÈ¡xmlÎĵµºÍ¹ÜÀí½Úµã¡£ÏÂÃæ½«½éÉÜOracle
xmltypeµÄһЩ»ù±¾Ê¹Óá£
1.½¨Á¢º¬ÓÐOracle xmltypeÊý¾ÝÀàÐ͵ıícreate table abc (id number,xmldoc
sys.xmltype);ÉùÃ÷xmltypeÐÍ×Ö¶ÎÓÃ:sys.xmltype¡£
2.Ïò´øÓÐxmltypeÀàÐ͵ıí²åÈë´øÓÐÊý¾Ýinsert into abc (id,xmldoc) value (abc.nextval ,
sys.xmlType.createXML(''<name><a id="1" value="some
values">abc</a></name>'') );²åÈëÓÃ
sys.xmlType.createXML(''some xml doc'')
3.Ö±½Ó²éѯOracle xmltype×Ö¶ÎÀïÃæµÄÄÚÈݵõ½id=1µÄvalue±äÁ³µÄÖµselect
i.xmldoc.extract(''//name/a[@id=1]/@value'').getStringVal() as ennames,
id from abc iµÃµ½a½ÚµãµÄÖµselect id,
i.xmldoc.extract(''//name/a/text()'').getStringVal() as truename from
abc iµÃµ½½ÚµãidÊôÐÔµÄÖµSelect
hd.Data_t.extract(''/root/name/@id'').getStringVal() As Name from
sehr_house_data hd
4.¸üÐÂOracle xmltypeÀïÃæµÄÊý¾Ýupdate abc set
xmldoc=updateXML(xmldoc,''//name/a[@id=1]/@value'',''some new value'')
where ......(×¢Ò⣺Èç¹ûÀïÃæÃ»ÓÐ<a id="1">Õâ¸ö½Úµã£¬½«²»ÄÜupdate)
5.Ìí¼Ó³¬¹ý4k×Ö½ÚµÄxmlÎĵµµ½xmltypeÐÍ×ֶοÉÒÔͨ¹ýʹÓÃÁÙʱ±íµÄ°ì·¨ÊµÏÖ£º
¡ôÏȽ¨Á¢Ò»¸öÁÙʱµÄ±í£¬ÆäÖеÄÒ»¸ö×Ö¶ÎÊÇclob
ÀàÐÍ£»
¡ôÔÙ½«ÒªÐ´Èëxmltype×ֶεÄxml docдÈëÕâ¸öÁÙʱµÄclobÐ͵Ä×Ö¶ÎÖУ»
¡ô×îºóinsert into abc
(id,xmldoc) values (abc_q.nextval , sys.xmlType.createXML((select
content from ÁÙʱ±í where id=......)));
Ïà¹ØÎĵµ£º
ÏîÄ¿´ÓmysqlÇ¨ÒÆµ½ORACLEÖÐÓöµ½ÒÆÖ²ÎÊÌ⣬mysqlÖÐÖ§³Ölimit ¶øORACLE say no .
½â¾ö·½·¨ ÀûÓÃORACLEµÄαÁÐ rownumÀ´¿ØÖÆ¡£¡£
Mysql : select * from table limit 10
equl
ORACLE£º select * from table where rownum <= 10
ORACLE αÁнéÉÜ£º
ËæÊý¾Ý×ÖµäÒ»Æð×Ô¶¯´´½¨µÄÒ»¸ö±í,ÊôÓÚsysģʽ,ÈκÎÓû§¶¼¿ÉÒÔ·ÃÎÊ,&nbs ......
Êý¾Ý±íday_energyµ±Ç°ÎªÔ·ÖÇø±í£¬·ÖÇøÐÅÏ¢ÈçÏ£ºDE_200912,DE_201001,DE_201002.....,Ô·ÖÇø±í³öÏÖËٶȲéѯÂý£¬Òò´Ëͨ¹ý½¨Á¢ÈÕ·ÖÇø±í½øÐиÄÉÆ¡£
²ð·ÖÔ·ÖÇø±íµÄÓï¾äΪ£º
alter table day_energy split partition de_201001 at('20100102') into (partition de_20100101,partition de_20100102)
·ÖÎö£º
alter table ±íà ......
---------Êýѧº¯Êý
1.¾ø¶ÔÖµ
S:select abs(-1) value
O:select abs(-1) value from dual
2.È¡Õû(´ó)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.È¡Õû£¨½ØÈ¡£©
S:select cast(-1.002 as int) v ......
We are pleased to announce that Oracle has completed its acquisition of Sun Microsystems and Sun is now a wholly owned subsidiary of Oracle. With this news, we want to reiterate our commitment to deliver complete, open and integrated systems that help our customers improve the performance, reliabi ......