tailieunhanh - MySQL Database Usage & Administration PHẦN 7

và, vì bản chất giao dịch của họ, họ luôn ở trong một nhà nước thống nhất (MySQL làm cho họ thậm chí còn mạnh mẽ hơn bằng cách kiểm tra cho tham nhũng và sửa chữa chúng khi khởi động). Hỗ trợ cho các phím nước ngoài và cam kết, rollback, và cuộn về phía trước hoạt động hoàn thành bức tranh này là một trong hầu hết các định dạng bảng đầy đủ tính năng có sẵn trong MySQL. | 202 Part I Usage Finally XPath supports a number of different functions to work with nodes and node collections. While it s not possible to discuss them all here it s worthwhile mentioning the count function which counts the number of nodes in a node collection returned by a location path. Here s an example which counts the number of ingredients in the recipe mysql SELECT ExtractValue @xml - count ingredients item - AS value -------- value -------- I 6 I -------- 1 row in set sec Note Other XPath functions such as name and id are not currently supported by MySQL. Updating Records and Fields To update values in an XML document MySQL offers the UpdateXML function. This function accepts three arguments the source XML document the location path to the node to be updated and the replacement XML. To illustrate consider the next example which updates the author name mysql SET @xml UpdateXML @xml - author author John Doe author Query OK 0 rows affected sec mysql SELECT ExtractValue @xml author --------------------------------- ExtractValue @xml author --------------------------------- John Doe --------------------------------- 1 row in set sec Here s another example which updates the second ingredient mysql SET @xml UpdateXML @xml - item 2 item Coriander item Query OK 0 rows affected sec mysql SELECT ExtractValue @xml item 2 Chapter 8 Working with Data in Different Formats 203 ----------------------------------- ExtractValue @xml item 2 ----------------------------------- Coriander ----------------------------------- 1 row in set sec And here s one that removes the final step from the recipe mysql SET @xml UpdateXML @xml step @num 6 Query OK 0 rows affected sec mysql SELECT ExtractValue @xml step num 6 -------------------------------------- ExtractValue @xml step num 6 -------------------------------------- -------------------------------------- 1 row in set sec PART I Importing XML When it comes to importing XML data into a MySQL .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.