TAILIEUCHUNG - Oracle XSQL- P8
Oracle XSQL- P8Welcome to the exciting world of eXtended Structured Query Language (XSQL) development! What’s so exciting? Efficiency and ease of use. XSQL isn’t some razzle-dazzle technology to wow your users. It also isn’t the latest X standard du jour that no one can stop talking about until you ask, “But what does it do for me today?” The problem with all of the great stuff out there is that no one technology does it all. | 120 Chapter 7 Your users do not need to see the results in this form of course. If you would just like to say Thanks you can do so with this very simple stylesheet. It hides the raw XML. xml version xsl stylesheet xmlns xsl http 1999 XSL Transform version xsl template match html h1 Thanks h1 html xsl template xsl stylesheet To use the stylesheet you need to add the following line as the second line in your file xml-stylesheet type text xsl href Using xsql update-request The use of xsql update-request is very similar to the use of xsql insert -request. The general process is exactly the same. First you create your HTML form and set the action to an XSQL page. When the form is submitted the XSQL servlet will pass the parameters as XML to the XSQL page processor. You need a stylesheet to transform the passed XML to the canonical XML schema. The key difference really relates to the difference between SQL inserts and updates. An insert adds an entirely new row to your table. An update on the other hand modifies an existing row. To perform an update XSQL needs to know which row or rows in the database will be modified. This is done through the key-columns attribute of the xsql update-request element. It lists the columns that have to match for a particular row of data to be updated. First things first. For this example you can use the exact same form as was used for xsql insert-request. Assume that the e-mail address is staying the same and that the user wants to modify the organization and name. It would be simple enough to populate the fields in the form but you aren t quite ready to do that yet. For now life is hard for your users. Here is the modified HTML form that you should save as html body h1 Sign Up For Newsletter h1 form action method post table border 0 tr Database Modifications with XSQL 121 td Name td td input type text name name td tr tr td Email td td input type .
đang nạp các trang xem trước