- 浏览: 523768 次
- 性别:
- 来自: 深圳
-
文章分类
- 全部博客 (299)
- Oracle(pl/sql_Erp_Pro*C) (69)
- 设计模式 (4)
- spring (23)
- ext (17)
- apache开源项目应用 (4)
- jquery (16)
- 生活琐事 (8)
- 下载资源 (23)
- mysql (2)
- Eclipse使用积累 (5)
- 报表类(报表/图表) (13)
- php (4)
- Web多彩文本框 (3)
- json (4)
- jqgrid (2)
- ant (2)
- java算法积累 (8)
- EL表达式/JSTL (4)
- poi (3)
- gwt (2)
- 爬网第一步 (2)
- javascript (17)
- Javaweb (8)
- tomcat (1)
- flex (1)
- Java&DB (3)
- J2SE (7)
- linux (3)
- 数据结构 (1)
- dot net (5)
- struts (1)
- ibatis (1)
- log4j (1)
- 项目管理 (1)
- Java native interface(jni,jacob......) (5)
- applet (1)
- VB.net/C#.net/JNI (20)
- css (1)
- Sqlite (1)
- servlet (1)
- REST (1)
最新评论
-
wenhurena:
能不能给一下解压密码roki.work.2017@gmail. ...
Ebs解体新書と学習資料1 -
liutao1600:
楼主写的太好了,每天学习~~
Spring_MVC(6)测试 -
liutao1600:
太好了,每天学习你的文章~~~
Spring_MVC(3)表单页面处理 -
liutao1600:
学习了,太好了
Spring_MVC(2)控制层处理 -
liutao1600:
学习了~~~
Spring_MVC(1)构建简单web应用
XMLTYPE has built-in functions to allow us to manipulate the data values being placed into the column defined as SYS.XMLTYPE. Data may be inserted into the table using the sys.xmltype.createxml procedure like this:
SQL> CREATE TABLE testxml (id NUMBER(3), dt SYS.XMLTYPE); Table created. SQL> SQL> SQL> INSERT INTO testxml VALUES(111, 2 sys.xmltype.createxml( 3 '<?xml version="1.0"?> 4 <customer> 5 <name>Joe Smith</name> 6 <title>Mathematician</title> 7 </customer>')) 8 / 1 row created. SQL> SQL> SET LONG 2000 SQL> SQL> SELECT * 2 FROM testxml 3 / ID DT ------------------------------ 111 <?xml version="1.0"?><customer><name>Joe Smith</name><title>Mathematician</title></customer> SQL> SQL> drop table testxml; Table dropped. SQL>
Use sys.xmltype.createxml to add XML data to table
SQL> CREATE TABLE testxml (id NUMBER(3), dt SYS.XMLTYPE); Table created. SQL> SQL> SQL> INSERT INTO testxml VALUES(111, 2 sys.xmltype.createxml( 3 '<?xml version="1.0"?> 4 <customer> 5 <name>Joe Smith</name> 6 <title>Mathematician</title> 7 </customer>')) 8 / 1 row created. SQL> SQL> SET LONG 2000 SQL> SQL> SELECT * 2 FROM testxml 3 / ID DT ---------------------------------------------------------------------------------------- 111 <?xml version="1.0"?><customer><name>Joe Smith</name><title>Mathematician</title></customer> SQL> SQL> SELECT t.dt.getclobval() 2 FROM testxml t 3 WHERE ROWNUM < 2 4 / T.DT.GETCLOBVAL() -------------------------------------------------------------------------------- <?xml version="1.0"?> <customer> <name>Joe Smith</name> <title>Mathematician</title> </customer> SQL> SQL> drop table testxml; Table dropped. SQL> SQL>
Retrieve value from SYS.XMLTYPE column
SQL> CREATE TABLE testxml (id NUMBER(3), dt SYS.XMLTYPE); Table created. SQL> SQL> SQL> INSERT INTO testxml VALUES(111, 2 sys.xmltype.createxml( 3 '<?xml version="1.0"?> 4 <customer> 5 <name>Joe Smith</name> 6 <title>Mathematician</title> 7 </customer>')) 8 / 1 row created. SQL> SQL> SET LONG 2000 SQL> SQL> SELECT * 2 FROM testxml 3 / ID DT ------------------------------------------------------------------------------------------------------------ 111 <?xml version="1.0"?><customer><name>Joe Smith</name><title>Mathematician</title></customer> SQL> SQL> SQL> SELECT * 2 FROM testxml t 3 WHERE t.dt.getclobval() LIKE '%Joe%' 4 / ID DT ------------------------------------------------------------------------------------------------------ 111 <?xml version="1.0"?><customer><name>Joe Smith</name><title>Mathematician</title></customer> SQL> SQL> drop table testxml; Table dropped. SQL> SQL>
Individual fields from the XMLTYPE'd column may be found using the EXTRACTVALUE function like this:
SQL> SQL> SQL> --EXTRACTVALUE is an Oracle function that uses an XPath expression, SQL> SQL> CREATE TABLE testxml (id NUMBER(3), dt SYS.XMLTYPE); Table created. SQL> SQL> SQL> INSERT INTO testxml VALUES(111, 2 sys.xmltype.createxml( 3 '<?xml version="1.0"?> 4 <customer> 5 <name>Joe Smith</name> 6 <title>Mathematician</title> 7 </customer>')) 8 / 1 row created. SQL> SQL> SET LONG 2000 SQL> SQL> SELECT * 2 FROM testxml 3 / ID DT ---------------------------------------------------------------------------------------------------- 111 <?xml version="1.0"?><customer><name>Joe Smith</name><title>Mathematician</title></customer> SQL> SQL> select EXTRACTVALUE(t.dt,'//customer/name') from testxml t; EXTRACTVALUE(T.DT,'//CUSTOMER/NAME') ----------------------------------------------------------------------------------------- Joe Smith SQL> SQL> SQL> drop table testxml; Table dropped. SQL> SQL>
Creation of tables using XMLType data type and set the xml schema
SQL> SQL> CREATE TABLE xml_or ( 2 id NUMBER PRIMARY KEY, 3 doc XMLTYPE) 4 XMLTYPE doc STORE AS OBJECT RELATIONAL 5 XMLSCHEMA "http://127.0.0.1/xdoc.xsd" 6 ELEMENT "doc" 7 /
Insert xml document to a XMLType column with xmltype function
SQL> CREATE TABLE myTable( 2 id NUMBER PRIMARY KEY, 3 emps XMLType NOT NULL 4 ); Table created. SQL> SQL> INSERT INTO myTable VALUES (1, xmltype('<?xml version="1.0" standalone="no" ?> 2 <emps> 3 <emp> 4 <home_address>address 1</home_address> 5 </emp> 6 </emps>') 7 ); 1 row created. SQL> SQL> SQL> select extract(emps, '/emps/emp/home_address/text()' ) 2 from myTable 3 / EXTRACT(EMPS,'/EMPS/EMP/HOME_ADDRESS/TEXT()') ------------------------------------------------------ address 1 1 row selected. SQL> SQL> SQL> drop table myTable; Table dropped. SQL> SQL> SQL>
PL/SQL ability to access text within an XML document in the database
SQL> CREATE TABLE myTable 2 (id NUMBER PRIMARY KEY 3 ,doc XMLType NOT NULL) 4 XMLTYPE doc STORE AS CLOB 5 / Table created. SQL> SQL> SQL> SQL> DECLARE 2 v_doc XMLType; 3 v_text varchar2(100); 4 BEGIN 5 select doc into v_doc from myTable 6 where id = 2; 7 8 v_text := v_doc.extract('/message/body/text()' ).getstringval; 9 10 dbms_output.put_line(v_text); 11 END; 12 / SQL> SQL> drop table myTable; Table dropped. SQL>
Query xmltype column
SQL> create table myTable( 2 id number(9), 3 myValue xmltype 4 ); Table created. SQL> begin 2 dbms_xmlschema.registerSchema ('http://d.com/myType.xsd',xdbURIType('/xsd/myType.xsd').getClob(),True,True,False,True); 3 end; 4 / SQL> SQL> insert into myTable values (67, XMLTYPE('<myType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://d.com/myType.xsd"> 2 <value1>1</value1> 3 <value2>2</value2> 4 </myType>')) 5 / 1 row created. SQL> SQL> select * from myTable; emp Number ------ MYVALUE ------------------------------------------------------ 67 <myType xmlns:xsi="http://www.w3.org/2001/XMLSchema-in stance" xsi:noNamespaceSch 1 row selected. SQL> SQL> drop table myTable; Table dropped.
Store an XMLType type data in clob
SQL> CREATE TABLE myTable 2 (myID NUMBER PRIMARY KEY, 3 myValue XMLTYPE ) 4 XMLTYPE myValue STORE AS CLOB 5 / Table created. SQL> SQL> drop table myTable; Table dropped. SQL> SQL>
Use value function with single xmltype table
SQL> create table myTable of xmltype; Table created. SQL> SQL> insert into myTable values(XMLTYPE(' 2 <customer> 3 <name>Chris</name> 4 <telephone>123 555-1234</telephone> 5 </customer>')) 6 / 1 row created. SQL> SQL> select * from myTable; SYS_NC_ROWINFO$ ------------------------------------------------------ <customer> <name>Chris</name> <telephone>123 555-1234</telephone> </ 1 row selected. SQL> SQL> update myTable c 2 set value(c) = updateXML(value(c), '/customer/name/text()','new value') 3 / 1 row updated. SQL> SQL> SQL> select extractvalue(value(c),'/customer/telephone') 2 from myTable c 3 where existsnode(value(c),'/customer/name = "Chris"') = 1 4 / no rows selected SQL> SQL> drop table myTable; Table dropped. SQL>
Use xmltype to convert xml string to xmltype data
SQL> SQL> SQL> CREATE TABLE myTable( 2 id NUMBER PRIMARY KEY, 3 emps XMLType NOT NULL 4 ); Table created. SQL> SQL> INSERT INTO myTable VALUES (1, xmltype('<?xml version="1.0" standalone="no" ?> 2 <emps> 3 <emp> 4 <home_address>address 1</home_address> 5 </emp> 6 </emps>') 7 ); 1 row created. SQL> SQL> SQL> select extract(emps, '/emps/emp/home_address/text()' ) 2 from myTable 3 / EXTRACT(EMPS,'/EMPS/EMP/HOME_ADDRESS/TEXT()') ------------------------------------------------------ address 1 1 row selected. SQL> SQL> SQL> drop table myTable; Table dropped. SQL> SQL>
发表评论
-
IBatis调用ORACLE的存储过程、函数的返回结果集例子
2012-03-05 23:31 2153import java.io.Serializabl ... -
Oracle分页函数样例——用于提高当前框架分页性能
2012-03-05 23:27 1404create or replace procedure P ... -
Oracle入门课件
2011-12-11 22:43 1035下载附件 -
自己经常上的Oracle官网的一些链接~~是啥自己点开看
2011-11-17 23:27 1135http://www.oracle.com/pls/db ... -
Oracle性能诊断艺术源码
2011-08-16 00:51 897请下载。 -
oracle support
2011-06-23 16:34 939https://support.oracle.com/CSP/ ... -
oracle 11g sql code
2011-02-24 20:55 1142附件参考 -
Oracle SQL优化
2011-01-19 23:16 888详见附件。讲述优化器。 -
Oracle PGA概念及调整
2011-01-03 23:18 1759--预备知识PGA(Process Global Area), ... -
修改Oracle SGA——防止oracle内存分配不足而down机
2011-01-03 23:16 2359在安装oracle 10g r2 数据库时,默认的SGA大 ... -
oracle SGA
2011-01-03 23:14 1373系统全局区又称SGA (System Global A ... -
Oracle 高水位概念(hwm)
2010-12-22 22:09 1459说到HWM,我们首先要简要 ... -
CDC积累的plsql用的各种例子
2010-11-09 15:49 851自用,有密码!请勿浪费时间下载。 -
oracle Erp安装和具体财务模块介绍
2010-10-11 12:54 1196http://bbs.erp100.com/thread-20 ... -
Oracle察看表约束
2010-10-08 16:07 11251、我们创建的对象可以从"USER_"开通 ... -
Oracle 行列转换积累
2010-09-29 11:36 1720行列转换包括以下六种情况:*列转行*行转列*多列转换成字符串 ... -
oracle bulk collection
2010-09-14 18:26 1277Oracle Bulk Collection & ... -
oracle discover
2010-09-03 16:28 973oracle discover -
Oracle rawtohex hextoraw
2010-09-03 15:03 3206Oracle 8.1.7 SQL> ed ... -
Oracle Raw,number,varchar2转换
2010-09-03 14:56 2271Oracle Raw,number,varchar2...转换 ...
相关推荐
所属区域: " + node1.getAttributes().getNamedItem("type").getNodeValue() + ". "); NodeList nodeDetail = node1.getChildNodes(); for (int j = 0; j < nodeDetail.getLength(); j++) { Node detail = node...
`debug`和`detail`参数用于控制Struts框架的日志级别,调试期间可以提高这些值以获取更详细的错误信息。 配置Struts1的`struts-config.xml`文件:此文件是Struts框架的核心配置文件,它定义了Action的映射、Form ...
Module: feature-payment-detail Type: INSTRUCTION, Covered: 3166, Missed: 4665, Total: 7831, Coverage: 40.43 Type: BRANCH, Covered: 185, Missed: 287, Total: 472, Coverage: 39.19 Type: LINE, Cov
header("Content-type: text/xml"); echo "<?xml version='1.0' encoding='UTF-8'?>"; echo "<users>"; echo "<user><name>小小菜鸟</name><age>24</age><sex>男</sex></user>"; echo "<user><name>艳艳</name><age>...
with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and...
2. **detail0**: 这是处理配置文件的Digester的调试级别。值范围从0(关闭)到6(最严格)。0表示关闭调试,更高的数字意味着更详细的日志输出。 3. **validating**: 如果设置为`true`,Struts将使用验证XML解析器...
在循环中,我们检查每个节点是否是`<Account>`元素,并获取其属性(如`type`),然后遍历`<Account>`元素的子节点以获取`<code>`、`<pass>`和`<name>`: ```java if ("Account".equals(node1.getNodeName())) { //...
Ajax(Asynchronous JavaScript and XML)是一种基于 JavaScript 和 XML 的异步传输技术,在 J2EE 项目开发过程中得到了广泛的应用。Ajax 技术可以让开发者不需要重新加载整个页面,而只需要通过与后台数据库的交互...
P_ARR_OUT(V_IDX) := ARR_OBJECT(V_WEALTH_DEAL_DETAIL.TRADE_NO, V_WEALTH_DEAL_DETAIL.DEAL_TYPE, V_WEALTH_DEAL_DETAIL.TURNOVER); V_IDX := V_IDX + 1; END LOOP; CLOSE CUR_WEALTH_DEAL_DETAIL; END pro_...
Java可以轻松地解析和操作XML文件,通常使用`javax.xml.parsers`包中的类来实现这一功能。以下是一个简单的示例,演示了如何使用DOM解析器读取XML文件并提取特定的数据: ```java import javax.xml.parsers....
setContentView(R.layout.activity_news_detail); String newsId = getIntent().getStringExtra("news_id"); // 加载详情页面 } } ``` #### 三、总结 本案例涵盖了Android开发中几个重要的方面,包括网络通信...
The XML file config.xml has format <!-- Format by commas" Protocol="TCP|UDP|Both"/> --> * The user can also add port info to config.xml as long as it follows the format. * Service ...
xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-reverse-engineering SYSTEM ...
$result = $WeixinPay->setWeiXinPay($data['pay_body'], $data['pay_detail'], $data['pay_money'] * 100, $out_trade_no, $red_url, $trade_type, $openid, $product_id); APP加密:$WeChatSDK->GetAppParameters...
@Insert("INSERT INTO items (name, price, detail, pic, createtime) VALUES (#{name}, #{price}, #{detail}, #{pic}, #{createtime})") void insertItem(Item item); } ``` **2、删除操作** 同样地,在XML映射...
| detail | 设置Digester的debug级别,Digester用于解析XML配置文件 | 0(记录最少日志信息) | ##### 3.2 调试级别设置 - **debug**:控制ActionServlet的调试信息输出,更高的debug级别可以提供更多的调试信息。...
深入研究这些源码,你可以了解到如何配置 Struts 的 XML 配置文件,如何编写 Action 类,以及如何在 EXT 中定义组件和数据源,以及如何利用 EXT Direct 实现前后端通信。 总结来说,"ext json struts 完整无错源码...
<Environment name="solr/home" type="java.lang.String" value="D:/solr/apache-solr-3.5.0/example/solr" override="true" /> ``` - 上述配置指定了Solr应用的基本位置以及其运行时的home目录。 4. **启动...