Databases Reference
In-Depth Information
array ( g f01 ) would contain the values for the checked items only; there was no really good way to get
around this problem.
APEX 4 changed this for the better by introducing the Single Checkbox item. This item can be used
like any other item and is capable of storing either a single value for checked (activated) or NULL for the
empty state.
In order to demonstrate how this feature works, we will need to do a couple of preparation steps
first:
1.
Create a new workspace. (You need to make sure that your instance settings
allow creation of the demo application, Workspace: INTERNAL Home
Manage Instance Feature Configuration.“Create demonstration objects in
new workspaces” needs to be set to Yes.).
2.
This will create the required tables you need for this demonstration (EMP and
DEPT).
3.
Change the EMP table by adding an additional column and changing one of
the columns, as shown in Listing 3-1.
4.
Create a new application.
5.
Create a tabular form using a wizard based on the EMP table and include all
the columns.
Note Together, these steps provide a framework from which to experiment with the Simple Checkbox feature.
Listing 3-1 shows the code to modify the EMP and DEPT tables. The valid column added to table EMP is the
checkbox column.
Listing 3-1. Extending EMP and DEPT Tables
ALTER TABLE emp MODIFY (ename VARCHAR2(40) NOT NULL);
ALTER TABLE emp ADD (valid VARCHAR2(1));
CREATE TABLE emp bkp AS SELECT * FROM emp;
CREATE TABLE dept bkp AS SELECT * FROM dept;
CREATE SEQUENCE dept seq START WITH 50 INCREMENT BY 10 NOCACHE;
CREATE SEQUENCE emp seq START WITH 7950 INCREMENT BY 1 NOCACHE;
CREATE OR REPLACE TRIGGER dept tr
BEFORE INSERT
ON dept
FOR EACH ROW
BEGIN
IF :NEW.deptno IS NULL
Search WWH ::




Custom Search