Information Systems College of Business Administration University of Missouri - St. Louis

Database Issues

General Introduction to Forms: see Sauter's forms links

General Directions for Formservlet: Campus Links

Prepare the setup in your account

Some helpful SQL:
* to copy my table example (where "george" is what you want to name your table):
     CREATE TABLE george AS SELECT * FROM sauter.example;
     COMMIT;

* to grant others the right to see your table (where "george" is the name of the table):
     GRANT SELECT ON george TO PUBLIC;

* to find the names of all of your tables:
     SELECT table_name FROM USER_TABLES;

* to eliminate a table (where "george" is the name of your table):
     DROP TABLE george;

* to change an entry in a table
            (where "example" is the name of the table and
            "Name" and "Student_id" are fields in that table):
     UPDATE example
     SET Name = 'Milharcic'
     WHERE Student_id = '100';

Examples

Database Example 1: Select Record
  • The code with highlighting
  • The code as a text file    -- IE users: right click and save to view
  • Build the response page:
    Head of the response page (myselect.head)    -- IE users: right click and save to view
    Body of the response page (myselect.body)    -- IE users: right click and save to view
    Foot of the response page (myselect.foot)    -- IE users: right click and save to view
  • SQL file (class_select.sql)

    1
    SELECT Student_id, Name, Score FROM example WHERE Name='}}Name{{';

  • Database Example 2: Insert Record
  • The code
  • The code as a text file    -- IE users: right click and save to view
  • SQL file (class_insert.sql)

    1
    INSERT INTO example (Student_id, Name, Score) VALUES ('}}REQId{{', '}}Name{{', '}}Score{{');

  • Database Example 3: Delete Example
  • The code with highlighting
  • The code as a text file    -- IE users: right click and save to view
  • Build the response page:
    Head of the response page (mydelete.head)    -- IE users: right click and save to view
    Body of the response page (mydelete.body)    -- IE users: right click and save to view
    <tr>
    <td><h4><font face="arial">}}1{{</td>
    <td><h4><font face="arial">}}2{{</td>
    <td><h4><font face="arial">}}3{{</td>
    <td><h4><font face="arial"><input type="hidden" name="Name" value="}}2{{"></td>
    <td><h4><font face="arial"><input type="radio" name="Score" value="}}3{{"></td>
    </tr>
    Foot of the response page (mydelete.foot)    -- IE users: right click and save to view
  • SQL file (class_select_delete.sql)

    1
    SELECT Student_id, Name, Score FROM example WHERE Name='}}Name{{';

  • SQL file (class_delete.sql)

    1
    DELETE FROM example WHERE Score='}}Score{{' AND Name='}}Name{{';

  • | Go to UM-St. Louis Home Page | College of Business Page | IS Home Page | Resource Page |



    Page Owner: Professor Sauter (Vicki.Sauter@umsl.edu)
    © 2004, Vicki L. Sauter. All rights Reserved.