USING XQUERY WITH THE XML DATA TYPE 7. If the cast fails, a dynamic error is raised. 8. The result of the comparison is true if the value of the first operand is (equal, not equal, less than, less than or equal, greater than, greater than or equal) to the value of the second operand; otherwise, the result of the comparison is false. B.2 Operator Mapping describes which combinations of atomic types are comparable and how comparisons are performed on values of various types. If the value of the first operand is not comparable with the value of the second operand, a type error is raised. Quite a bit more complex, don t you agree? SQL is a more strongly typed language than XQuery. In XQuery, static typing is possible but optional, although SQL Server s implementation of XQuery implements static typing. In SQL, strong typing is required. When static typing is used, having schemas assists optimization. Both SQL and XQuery are declarative languages; however, Transact-SQL is more procedural, especially when combined with stored procedures that can contain procedural logic. Oracle s Transact-SQL equivalent, PL/SQL, actually stands for Procedural Language extensions to SQL. While we re mentioning stored procedures, the XQuery equivalent to SQL s stored procedures and user-defined functions (Persistent Stored Modules, as they are called in ANSI SQL) is user-defined functions. XQuery allows for implementation- dependent extensions to store and access user-defined functions in libraries. XQuery s functions are supposed to be side effect free. All of SQL s PSMs are not guaranteed to be side effect free, although SQL user- defined functions can make this guarantee. In conclusion, the SQL SELECT statement has a lot in common with the XQuery language, though XQuery is more complex because of the underlying data model. XQuery has some of the functionality of data manipulation through the use of constructors, but no way to affect the underlying data. It more reflects the querying and reporting functionality of SQL SELECTand stored procedures. Using XQuery with the XML Data Type SQL Server supports XQuery on the XML data type directly. It does this through four of the XMLdata type s methods. xml.querytakes an XQuery query as input and returns an XMLdata type as a result.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services

Bookmark the permalink.

Comments are closed.