Databases Reference
In-Depth Information
Chapter 12
A Websheet Example
The previous chapter covered many of the different features in websheets. In this chapter, you use these features to
build an application from scratch.
The example application manages a corporate soccer team. Currently, the player roster and schedules are
maintained in spreadsheets. When the schedule is updated, the spreadsheet is e-mailed to all the players. As you can
imagine, it would be very frustrating to manage a team this way.
A websheet is a good way to manage the soccer team because websheets can be built with minimal developer
or DBA assistance. All the files, along with a copy of the final application, can be found in the example download
described in the introduction to this topic.
Setup
In order to highlight the capability of websheets to interact with objects in your database, let's create some database
objects that are referenced throughout the chapter. These objects simulate an existing users table and login function
for your organization:
1.
Run the following code, which is included in the example download as a script named
ch12_database_objects.sql , in SQL*Plus or directly in APEX using the SQL workshop:
-- Create Users Table
CREATE TABLE tusers (
user_id NUMBER (5, 0) PRIMARY KEY,
user_name VARCHAR2 (10) NOT NULL UNIQUE,
password VARCHAR2 (10) NOT NULL,
active_flag VARCHAR2 (1) NOT NULL
);
-- Create sequence for IDs
CREATE SEQUENCE sn_users;
-- Create Users
-- Note: You should not store passwords in clear text.
-- This was done for demonstration purposes.
INSERT INTO tusers ( user_id, user_name, password, active_flag)
VALUES (sn_users.NEXTVAL, 'martin', 'martin', 'Y');
INSERT INTO tusers ( user_id, user_name, password, active_flag)
VALUES (sn_users.NEXTVAL, 'chris', 'chris', 'Y');
 
Search WWH ::




Custom Search