Learn XQuery |
Home:Learn XQuery:White Papers:Generating SQL:External Variables External VariablesPrepared queries in XQJ are analogous to SQL prepared statements; they use XQuery external variables in the same way that SQL uses parameter markers. The DataDirect XQuery® SQL Adapter converts queries with external variables into SQL prepared statements (except when an external variable contains a sequence — this case is discussed in Example 11). Example 10. XQuery External VariablesXQuery declare variable $shares as xs:integer external; Generated SQL SELECT ALL Example 11. Sequences as External VariablesXQuery supports sequences as external variables, but in SQL, a parameter is a single value. DataDirect XQuery® uses temporary tables in the database to represent XQuery external variables that contain sequences. The sequence is inserted into the temporary table using batch insert in order to minimize the number of database round trips. XQuery declare variable $shares as xs:int* external; Generated SQL INSERT INTO RATEMP009368710001( RAVAR, RAINT) VALUES(0, ?); |
Try DataDirect XQuery® Free!Put the power, scalability, and performance of DataDirect XQuery® to work for you today! Our free trial lets you see for yourself how easy it is to build data integration applications that access relational, EDI, and other file formats as XML! Online Video Tutorials!Our easy-to-follow online video tutorials are a great way to get acquainted with the many features of DataDirect XQuery®. And if you like what you see, download a free copy today and try DataDirect XQuery® for yourself! Back to School with DataDirect XQuery®Getting your mind around the possibilities of a data integration technology as promising as XQuery can be difficult, but our XML developers Webinars will help you understand the power and versatility of XQuery, and our favorite XQuery processor, DataDirect XQuery®. New Features in DataDirect XQuery®DataDirect XQuery® is now released! DataDirect XQuery® provides full update support for relational data, easy integration for Web Services, additional enhancements for performance and scalability and more! |





