Oracle Database 10g XML SQL [Electronic resources] : Design, Build Manage XML Applications in Java, C, C++ PL/SQL نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Oracle Database 10g XML SQL [Electronic resources] : Design, Build Manage XML Applications in Java, C, C++ PL/SQL - نسخه متنی

Mark V. Scardina, Ben Chang, Jinyu Wang

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید











Running the Application

Once you have the source code compiled and linked, it can be run connecting to the database specified by your ORACE_SID environment setting and using the HR/HR userID/Password. The following is an example command line with its result.

 selectxpq “select XMLELEMENT("EmployeeList", XMLAGG(XMLELEMENT("Employee", 
XMLATTRIBUTES( employee_id AS "EmpID"), XMLELEMENT("Name", first_name
|| ' '|| last_name), XMLELEMENT("Salary", salary))))AS result FROM
hr.employees where Salary > 13000” “//Employee/Name[../Salary="17000"]”

This query returns the following XML document from the employees table:

 <EmployeeList>  
<Employee EmpID="100">
<Name>Steven King</Name>
<Salary>24000</Salary>
</Employee>
<Employee EmpID="101">
<Name>Neena Kochhar</Name>
<Salary>17000</Salary>
</Employee>
<Employee EmpID="102">
<Name>Lex De Haan</Name>
<Salary>17000</Salary>
</Employee>
<Employee EmpID="145">
<Name>John Russell</Name>
<Salary>14000</Salary>
</Employee>
<Employee EmpID="146">
<Name>Karen Partners</Name>
<Salary>13500</Salary>
</Employee>
</EmployeeList>

The XPath expression //Employee/Name[../Salary="17000"] asks for all the names of employees whose salary is equal to 17000 and returns the following XML fragment:

 <Name>Neena Kochhar</Name> 
<Name>Lex De Haan</Name>

/ 218