home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / WIN95 / INTERNET / h12395co.exe / data.1 / dbsdemo.hei < prev    next >
Encoding:
Text File  |  1997-11-05  |  2.0 KB  |  85 lines

  1. <include sesfield.hei>
  2. <include layout/heilay.hei>
  3. <include dbs.hei>
  4.  
  5. <session mode="create">
  6. <heitmlpage title="SQL Scroll Form">
  7.  
  8. <if !isdecl(se.Scroller);
  9.    se.Scroller=null;
  10. /if>
  11.  
  12. Now you can enter an arbitrary SQL-Query on our example database. Here are a
  13. few variations on the SELECT command that you might like to try:
  14. <p>
  15.  
  16. <box>
  17. <FONT SIZE="-1"><b>
  18. <ul>
  19. <li>  SELECT * FROM guestbook 
  20. <li>  SELECT Guest_Name FROM guestbook ORDER BY Guest_Name
  21. <li>  SELECT DISTINCT  Guest_Name, Email, Address FROM guestbook ORDER BY Guest_Name 
  22. <li>  SELECT COUNT (*) FROM guestbook
  23. <li>  SELECT COUNT (*) FROM guestbook WHERE Country="USA"
  24. <li>  SELECT * FROM guestbook WHERE Guest_Name LIKE 'R%'
  25. </ul>
  26. </FONT></b>
  27. </box>
  28.  
  29. <p>
  30.  
  31. Watch how the Query Result changes depending on the form of the SELECT command
  32. that you enter.
  33.  
  34.  
  35. /******************************************************************
  36.  Here is the input form that allows the user to enter
  37.  an SQL query. It is a sessionForm, displaying and updating
  38.  session variables.
  39. ******************************************************************/
  40. <sessionForm>
  41.   <sessionButton name="SQuery" value="Query">
  42.   <INPUT TYPE="reset"  VALUE="Reset"> 
  43.   <sa href="demo.hei"> Back </sa>
  44.   <sessionButton name="Apply">
  45.   <br>
  46.   <if (isempty(se.query));  se.query="SELECT * FROM guestbook"; /if>
  47.   <sessionTextArea "Query" ROWS=6 COLS=55 wrap="physical"> 
  48.   <p>
  49.   Maximal Number of rows to read :
  50.   <let se.max=default(se.max,100); sessionFi "max" 10 type="i"><br>
  51. //  Number of Rows per page:
  52. //  <let se.pgsize=default(se.pgsize,5); sessionFi "pgsize" 10 type="i">
  53. </sessionForm>
  54.  
  55. // We do the following, when the QUERY button has been pressed
  56. <if !isempty(ff.Squery) && SrvDebug;
  57.    dbsQuery se.Scroller max=se.max;
  58.       ? se.Query;
  59.    /dbsQuery;
  60. /if>
  61.  
  62. <dbsScroller se.Scroller>
  63.    <table border>
  64.       <dbsTableHead se.Scroller>
  65.       <dbsTableBody se.Scroller>
  66.    </table>
  67.    <p>
  68.    <dbsControlLine se.Scroller>
  69. </dbsScroller;
  70.  
  71.  
  72. /heitmlpage;
  73. /session>
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.