Beruflich Dokumente
Kultur Dokumente
40034GC11
Production 1.1
June 2001
D33132
Author
Ian Purvis
Technical
Contributors and
Reviewers
Cem Ayberkin
Gunnar Bohrs
Brian Boxx
Libor Danek
Laurent Dereac
Brain Fry
Pam Gamer
Pascal Gibert
Thierry Guibert
Ellen Gravina
Norris Gray
Anthony Hargreaves
Ali Hiemstra
Barry Hiern
Ursula Hovy
Sarah Jones
Jan Keuben
Aija Lehtonen
Regis Louis
Kenji Makita
Jayne Marlow
Sergei Pechersky
Milos Randak
Jonas Reborg
Bryan Roberts
Candace Stover
Hiroyuki Sugiyama
Laura Tejero
Jack Walsh
Publisher
Shane Mattimoe
Contents
.....................................................................................................................................................
Contents
Preface
Profile xv
Related Publications xvi
Typographic Conventions xvii
Introduction
Introduction I-2
Course Content I-3
Lesson 1: Creating a Menu Module
Introduction 1-3
Components of the Menu Module 1-5
The Default Menu 1-7
The Menu Editor 1-9
Creating a Menu Module 1-11
Module Properties 1-13
Menu Properties 1-15
Menu Item Properties 1-17
Menu Item Types 1-19
Menu Item Command Types 1-21
Implementing Menu Toolbars 1-23
Storing the Menu Module 1-25
Attaching the Menu Module 1-27
Pop-up Menus 1-29
Summary 1-31
Practice Overview: Lesson 1 1-33
Practice 1 1-34
Lesson 2: Managing Menu Modules
Introduction 2-3
Using PL/SQL in Menu Item Code 2-5
Useful Built-in Menu Subprograms 2-7
.....................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
iii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
iv
Oracle iDS Forms: Build Internet Applications II
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
v
Contents
.....................................................................................................................................................
.....................................................................................................................................................
vi
Oracle iDS Forms: Build Internet Applications II
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
vii
Contents
.....................................................................................................................................................
.....................................................................................................................................................
viii
Oracle iDS Forms: Build Internet Applications II
Contents
.....................................................................................................................................................
15-5
.....................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
ix
Contents
.....................................................................................................................................................
Practice 6 Solutions
Practice 7 Solutions
Practice 8 Solutions
Practice 9 Solutions
Practice 10 Solutions
Practice 11 Solutions
Practice 12 Solutions
Practice 13 Solutions
Practice 14 Solutions
Practice 15 Solutions
A-15
A-16
A-18
A-21
A-24
A-27
A-30
A-33
A-35
A-37
B-2
.....................................................................................................................................................
x
Oracle iDS Forms: Build Internet Applications II
Contents
.....................................................................................................................................................
.....................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
xi
Contents
.....................................................................................................................................................
.....................................................................................................................................................
xii
Oracle iDS Forms: Build Internet Applications II
................................
Using Reusable
Components
Lesson
11: Using Reusable Components
......................................................................................................................................................
Objectives
Instructor Note
Topic
Lecture
Timing
20 minutes
Practice
35 minutes
Total
55 minutes
......................................................................................................................................................
11-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
In this lesson, you will learn about the reusable components that are
available with Oracle Forms Developer. You will learn how these
components can fit into any application.
Objectives
After completing this lesson, you should be able to do the following:
List the reusable components
Include the calendar object in an application
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-3
Lesson
11: Using Reusable Components
......................................................................................................................................................
Reusable Components
Picklist
Calendar
Instructor Note
Students may copy and use the icons, images, ActiveX controls, menus, and
all other files provided in the demonstrations into their own applications.
Oracle Corporation retains all copyrights on these demonstrations,
components, icons, ActiveX controls, and images. There is no license or fee
required for any such reuse. However, Oracle Corporation does not provide
any support for these components. These components are provided as is.
Some of the demonstrations and reusable components require PL/SQL
features that are supported only in Oracle7 release 7.3 or later.
......................................................................................................................................................
11-4
Oracle iDS Forms: Build Internet Applications II
Reusable Components
......................................................................................................................................................
Reusable Components
Oracle Forms Developer contains a complete set of demonstrations that
illustrate the power and productivity of the product. These demonstrations
contain many tips and techniques that you can copy and use in your own
applications.
Reusable Component Definition
A reusable component is a generic object (object group, block, PL/SQL
library, and so on) that you can reuse in all your applications. You can create
your own reusable components (code and object) by using the generic
programming characteristics.
Oracle Forms Developer also includes a number of reusable components
that enable you to easily and rapidly build applications that provide power
and performance while conforming to GUI standards. You can customize
these components.
Web Design Tip
JavaBeans and Enterprise JavaBeans are reusable components that you can
use with Web-deployed Oracle Forms Developer applications. These allow
you to create a customized look and feel for the user interface, and to add
additional functionality. The deployment of JavaBeans is covered in a later
lesson.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-5
Lesson
11: Using Reusable Components
......................................................................................................................................................
ActiveX controls
Java Beans
Sample Icons
Standard Menus
PL/SQL Drag & Drop Library
PL/SQL Utilities Library
PL/SQL Conversion Library
PL/SQL Window System Interface Library
Instructor Note
Demonstration: Use Orders.fmb to demonstrate the implementation of
the calendar class and the picklist class.
Navigate to the DATE_ORDERED item and press [F9] to display the
calendar.
Click the PRODUCT_LOV button to display the picklist form.
......................................................................................................................................................
11-6
Oracle iDS Forms: Build Internet Applications II
Description
ActiveX controls
JavaBeans
Standard menus
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-7
Lesson
11: Using Reusable Components
......................................................................................................................................................
......................................................................................................................................................
11-8
Oracle iDS Forms: Build Internet Applications II
Reusable Component
Description
Calendar class
Picklist class
Wizard class
Help class
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-9
Lesson
11: Using Reusable Components
......................................................................................................................................................
Creating a Calendar
To create a calendar:
1. Copy or make the Calendar Object
Group a subclass.
2. Attach the PL/SQL library
CALENDAR.PLL.
3. Create a Key-Listval trigger.
4. Call Date_LOV.Get_Date.
......................................................................................................................................................
11-10
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-11
Lesson
11: Using Reusable Components
......................................................................................................................................................
......................................................................................................................................................
11-12
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-13
Lesson
11: Using Reusable Components
......................................................................................................................................................
Syntax
date_lov.get_date(
display_date,return_item,
window_x_pos,window_y_pos,
window_title,
ok_label,cancel_label,
highlight,
autoconfirm,autoskip );
Example
date_lov.get_date(sysdate,s_ord.date_ordered,240
date_lov.get_date(sysdate,s_ord.date_ordered,240
,60,Order
,60,Order Date,OK,Cancel,TRUE,FALSE,FALSE);
Date,OK,Cancel,TRUE,FALSE,FALSE);
Copyright Oracle Corporation, 2001. All rights reserved.
......................................................................................................................................................
11-14
Oracle iDS Forms: Build Internet Applications II
Argument
Description
display_date
The date to display when the Date List of Values window first
appears
return_item
The name of the block and item to which to return the chosen date
v_x_pos
v_y_pos
v_title
v_ok
v_cancel
v_highlight
v_autoconfirm
Specifies that the date immediately be returned when the end user
clicks a day
v_autoskip
Specifies that the input focus moves to the next item in sequence
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-15
Lesson
11: Using Reusable Components
......................................................................................................................................................
Summary
......................................................................................................................................................
11-16
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
Reusable Components
The purpose of a reusable component
Reusable components list
The Calendar Class
Create a calendar
Calendar Object Group content
Built-in for manipulating the calendar
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-17
Lesson
11: Using Reusable Components
......................................................................................................................................................
Practice 11 Overview
......................................................................................................................................................
11-18
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-19
Lesson
11: Using Reusable Components
......................................................................................................................................................
Practice 11
1 Create a picklist by using the picklist class. This picklist enables the end
user to select order items from a product list, and to place selections in a
second list.
a Create a new form module, called PICKXX where XX is your student
course number. Open the Form_Builder_II.olb object
library. This library contains form objects and code for the picklist.
Copy the PICKLIST_BASIC object group to your form module.
Copy the PICKLIST object group into your new form module.
b Ensure the CONTROL block is the last defined data block in the
Object Navigator.
c Attach the picklist.pll library. This contains the functions
and procedures required for creating the picklist.
d Define a When-New-Form-Instance trigger which will create and
populate the picklist. You can import the code from the
pr11_1.txt file.
Create the picklist with the picklist.Create_Picklist procedure.
Call function pick_list.Populate_Picklist_With_Query to populate
the List_in object. You must define a query that returns the ID, name
and suggested prices from the S_PRODUCT table.
Call pick_list.Set_Picklist_Selection procedure to select the first
element in the list.
Display both lists by using the pick_list.Display_Picklist procedure.
Exclude from the query any products already in the current S_ITEM
block. You should use the global variable :GLOBAL.where_cls.
e Save and compile your form. Deploy your form to the Web.
f In your ORDERS form, modify the When-Button-Pressed trigger for
the CONTROL.PRODUCT_LOV_BUTTON so that it calls your
new form module.
g Save and compile your form. Deploy your form to the Web to test.
......................................................................................................................................................
11-20
Oracle iDS Forms: Build Internet Applications II
Practice 11
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
11-21
Lesson
11: Using Reusable Components
......................................................................................................................................................
......................................................................................................................................................
11-22
Oracle iDS Forms: Build Internet Applications II
................................
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Objectives
Instructor Note
Emphasize that use of Java in Oracle Forms Developer does not require Java
programming skills. Students can build Web-deployed forms applications by
reusing Java class files, supplied either by Oracle or a third party.
Instructor Note
Topic
Lecture
Timing
40 minutes
Practice
25 minutes
Total
65 minutes
......................................................................................................................................................
12-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
In this lesson you will learn how to enhance Web-deployed forms by using
JavaBeans to customize the user interface. You will also learn about
Oracle8i features that may be used within Web-deployed Oracle forms.
Objectives
After completing this lesson, you should be able to do the following:
Customize the user interface
Incorporate JavaBeans in Web-deployed forms by
- Inserting Pluggable Java Components
- Creating Bean Areas
Exploit Oracle8i features with Web-deployed forms
Invoke the Java Importer Tool
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-3
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Platform independent
programs
Java Runtime
Environment
Forms Applet
Instructor Note
Advise students requesting further information on the deployment of Web
forms to attend the Oracle 9iAS Forms Services: Deploy Internet
Applications course.
......................................................................................................................................................
12-4
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-5
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Pluggable Java
Components
......................................................................................................................................................
12-6
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-7
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
......................................................................................................................................................
12-8
Oracle iDS Forms: Build Internet Applications II
Parameter Value
lookAndFeel
colorScheme
Technical Note
To enable the Web Previewer, you must have installed the Forms Server
Runtime Engine in your test environment.
Instructor Note
The JVM that is used by the Forms Applet may be:
Browser
JVM
Oracle
JInitiator
Applet
Viewer
This Java tool allows you to run the form Applet without using a
browser.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-9
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Defining Fonts
for Web-Deployed Forms
Use Java supported fonts:
Java Font
Windows Font
XWindows Font
Mac Font
Monospaced
Courier New
Adobe-courier
Courier
Geneva
Dialog
MS San Serif
b&h-lucida
DialogInput
MS San Serif
b&h-lucidatypewriter Geneva
Helvetica
Arial
Adobe-Helvetica
Symbol
Wingdings
itc-zapfdingbats
Times Roman
Helvetica
Symbol
Times Roman
......................................................................................................................................................
12-10
Oracle iDS Forms: Build Internet Applications II
Macintosh Font
Monospaced
Courier New
Adobe-courier
Courier
Dialog
Ms Sans Serif
b&h-lucida
Geneva
DialogInput
Ms Sans Serif
b&h-lucidatypewriter
Geneva
Helvetica
Arial
Adobe-Helvetica
Helvetica
Symbol
WingDings
itc-zapfdingbats
Symbol
TimesRoman
Adobe-times
Times Roman
At run time, Oracle Form Developer fonts are converted to their Java
equivalent using a reference to an alias file, Registry.dat. If your
selected Oracle Form Builder font does not map to a supported Java font, it
will be replaced with the default Java font. You can specify the default Java
font by editing the Java registry file. The Registry.dat file is located
in:
ORACLE_HOME/forms60/java/oracle/forms/registry/
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-11
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
List Item
Push Button
Text Item
Radio Button
......................................................................................................................................................
12-12
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-13
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Smoking ?
Radio Buttons
Cash
Credit Card
Cheque
Name: PasswordFieldPJC.class
Path :
FORMS60_JAVADIR oracle\forms\demos
Copyright Oracle Corporation, 2001. All rights reserved.
......................................................................................................................................................
12-14
Oracle iDS Forms: Build Internet Applications II
Description
Default value
Example
oracle.forms.demos.SecureText
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-15
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Bean Areas
Communicate
between Forms
Server and Client
with PL/SQL
button.
heres the
Date Changed event
and
a parameter list with
the selected date
......................................................................................................................................................
12-16
Oracle iDS Forms: Build Internet Applications II
Instructor Note
Use JAVAMENU.fmb to demonstrate the implementation of JavaBeans in
Bean Areas.
HyperLink is a JavaBean that allows the user to specify a URL and
browse the Internet.
Ticker is a JavaBean that displays the digital time.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-17
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Hosting a JavaBean
1. Define a Bean Area
2. Specify the JavaBean
3. JavaBean is visible in
Layout Editor
......................................................................................................................................................
12-18
Oracle iDS Forms: Build Internet Applications II
Hosting a JavaBean
......................................................................................................................................................
Hosting a JavaBean
You can host a JavaBean in your Oracle Forms Developer application by
creating a Bean area control item.
Creating a Bean Area
You can create a Bean Area in three ways:
Use the Bean Area Item tool in the Layout Editor
Use the Create icon in the Object Navigator
Convert an existing item
Associating a JavaBean with Your Bean Area
In order to associate your JavaBean with the Bean Area, you will need to
name the JavaBean class file in the Bean Area Implementation class
property. This property entry is mandatory.
Oracle Forms Developer will locate your JavaBean class files by searching
the Java directory, specified in the FORMS60_JAVADIR environment
variable.
Java is a case sensitive language, and you must ensure that the class file
name is precisely specified. You must also supply a fully qualified name.
For example, the location of MyEg.class file is:
FORMS60_JAVADIR/oracle/forms/demos/MyEg.class
You should therefore specify an entry in the Implementation class property:
oracle.forms.demos.MyEg
After you have specified the Implementation class property, the JavaBean
will be visible in the Bean Area (in the Layout Editor).
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-19
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
When-Custom-Item-Event trigger
System variables:
:SYSTEM.CUSTOM_ITEM_EVENT
:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS
......................................................................................................................................................
12-20
Oracle iDS Forms: Build Internet Applications II
System Variable
Description
:SYSTEM.CUSTOM_ITEM_EVENT
:SYSTEM.
CUSTOM_ITEM_EVENT_PARAMETERS
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-21
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
......................................................................................................................................................
12-22
Oracle iDS Forms: Build Internet Applications II
Example
SET_CUSTOM_PROPERTY(alarm_clock,1, wakeuptime, 1000);
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-23
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
......................................................................................................................................................
12-24
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-25
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Instructor Note.
Oracle JDeveloper has specific tools for creating JavaBeans. You should
make any students requesting further information on the creation of
JavaBeans aware of Oracle Java and JDeveloper courses.
......................................................................................................................................................
12-26
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-27
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
......................................................................................................................................................
12-28
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-29
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
1
2
3
4
......................................................................................................................................................
12-30
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-31
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Summary
......................................................................................................................................................
12-32
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
Customize the User Interface
Specifying Oracle look and feel
Specifying default Java fonts
Create JavaBean Areas
Inserting Pluggable Java Components
Creating Bean Areas
Communicating with JavaBeans
Exploit Oracle8i Features with Web-Deployed Forms
Java stored procedures
Enterprise JavaBeans
Business Components for Java
Use the Java Importer Tool
Utilize Java code contained in standard, compiled Java class libraries
from your Forms applications
Automate the generation of PL/SQL procedures and functions to
interface with a specified Java class
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-33
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Practice 12 Overview
Instructor Note
The practices include use of WEB.SHOW_DOCUMENT. Outline its
functionality and explain to students that it will be covered in a later lesson.
......................................................................................................................................................
12-34
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
12-35
Lesson
12: Using Java with Web-Deployed Forms
......................................................................................................................................................
Practice 12
1 Provide an alternative user interface for your Web-deployed forms by
......................................................................................................................................................
12-36
Oracle iDS Forms: Build Internet Applications II
................................
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Objectives
Instructor Note
Topic
Lecture
Timing
25 minutes
Practice
25 minutes
Total
50 minutes
......................................................................................................................................................
13-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
This lesson covers the use of Oracle database server features in Form
Builder applications. You will learn about storing and calling PL/SQL code,
handling Oracle database server errors, and issuing DDL commands from
within forms.
Objectives
After completing this lesson, you should be able to do the following:
Use Oracle database server functionalities in forms
Deal with server-side PL/SQL
Recognize which PL/SQL8 features are supported in forms
Handle Oracle database server errors
Perform DDL commands by using the FORMS _DDL built-in
subprograms
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-3
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Declarative constraints
Stored program units
Database triggers
DDL
......................................................................................................................................................
13-4
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-5
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Application partitioning
......................................................................................................................................................
13-6
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-7
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
......................................................................................................................................................
13-8
Oracle iDS Forms: Build Internet Applications II
PL/SQL8 Support
......................................................................................................................................................
PL/SQL8 Support
Oracle Forms Developer uses PL/SQL8 in the Oracle database server and
the Oracle Form Builder application. However, Form Builder module
program units currently cannot support Oracle8i object-related functionality.
The Stored Program Unit editor has been extended in Oracle Forms
Developer to allow editing of the type body (methods) and type
specification (attributes) of Oracle8i user-defined data types.
Object Iron Packages
Object Iron is a set of database packages that helps you to access tables
containing instances of Oracle8i object types. The packages generate a
table-specific package, which you use to access data from the specified
table. After generation, the table-specific package appears under the Stored
Program Units node. It contains code that allows you to select, insert,
update, delete, and lock records in the specified table.
Instructor Note
Oracle Forms Developer is backward-compatible with client-side program
units built using PL/SQL Version 2. Client-side program units created with
previous releases will run against the PL/SQL8 engine with no modification.
Although stored program units created with previous releases will run
against PL/SQL8, because of syntax incompatibility between PL/SQL8 and
PL/SQL Version 2, these stored program units may compile with errors.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-9
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
......................................................................................................................................................
13-10
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-11
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Unsupported Client-Side
PL/SQL8 Features
......................................................................................................................................................
13-12
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-13
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Trigger/PU
Oracle Server
Declarative
constraint
Database
trigger
Explicit DML
Stored PU call
Stored
program unit
Instructor Note
Demonstration: Use ServerSide.fmb to show the handling of errors
originating from a trigger, from a stored procedure, and from the database
server. Press the ServerSide formss HELP button to get instructions on
running the demonstration.
......................................................................................................................................................
13-14
Oracle iDS Forms: Build Internet Applications II
Error Message
Causes predefined error message
Error message specified in RAISE_APPLICATION_ERROR
Error message specified in RAISE_APPLICATION_ERROR
Explicit DML
Description
DML statements that are associated with base table blocks.
Implicit DML is also called base table DML. By default,
Forms constructs and issues these DML statements.
DML statements that a developer explicitly codes in triggers
or program units.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-15
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Oracle Server
Constraint
Predefined
message
DB trigger
RAISE_
APPLICATION_
ERROR
Stored PU
RAISE_
APPLICATION_
ERROR
Instructor Note
Stress that the On-Error trigger and the DBMS_ERROR_CODE and
DBMS_ERROR_TEXT functions are specifically for handling errors in
implicit DML. (Implicit DML consists of the INSERT, UPDATE, and
DELETE statements implicitly created when changes to a form are saved.)
The PL/SQL functions SQLCODE and SQLERRM are for use with explicit
DML. (Explicit DML consists of the INSERT, UPDATE, and DELETE
statements explicitly written into PL/SQL blocks in the form.)
......................................................................................................................................................
13-16
Oracle iDS Forms: Build Internet Applications II
Error Handling
Use the Forms built-ins DBMS_ERROR_CODE and
DBMS_ERROR_TEXT in an On-Error trigger.
Use the PL/SQL functions SQLCODE and SQLERRM in a
WHEN OTHERS exception handler of the trigger or program
unit that issued the DML statements.
Use the PL/SQL functions SQLCODE and SQLERRM in a
WHEN OTHERS exception handler of the trigger or program
unit that called the stored program unit.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-17
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Characteristics:
Characteristics:
Statement cannot return results directly
Use FORM_SUCCESS to check
success of statement
Hints:
Create SQL Query record group
instead of FORMS_DDL
Call stored program unit instead of
FORMS_DDL
......................................................................................................................................................
13-18
Oracle iDS Forms: Build Internet Applications II
Description
FORMS_DDL issues dynamic SQL statements at run time, including
server-side PL/SQL and DDL.
Parameter
The specified statement can be any string expression up to 32K
representing a:
PL/SQL block
DML statement
DDL statement
Do not end the PL/SQL block with a slash or the DML or DDL statement
with a semicolon.
Characteristics
FORMS_DDL is an unrestricted procedure that is also valid in Enter Query
mode.
The specified statement must not contain bind-variable references.
However, you can concatenate the values of bind variables into the
specified string.
The statement executed using FORMS_DDL cannot return results to
Forms directly.
Use the FORM_SUCCESS built-in to check whether the statement
issued using FORMS_DDL executed correctly.
Note: Consider using a query record group with a SELECT statement or
calling a stored program unit, instead of executing FORMS_DDL.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-19
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Instructor Note
Demonstration: Use ServerSide.fmb to show the creation of a
temporary table with FORMS_DDL.
......................................................................................................................................................
13-20
Oracle iDS Forms: Build Internet Applications II
Using FORMS_DDL
......................................................................................................................................................
Using FORMS_DDL
The following examples show how you can use the FORMS_DDL built-in
function.
Example
Create a temporary table at the start of a post.
Pre-commit trigger at form level:
BEGIN
FORMS_DDL(CREATE table temp(n_col number));
IF not FORM_SUCCESS THEN
MESSAGE (Table creation failed.);
RAISE form_trigger_failure;
END IF;
END;
Example
Execute a procedure with a given name. This is useful if you want to determine
dynamically which procedure should be executed in a certain situation.
PROCEDURE exec_proc (p_proc_name IN VARCHAR2)
IS
BEGIN
FORMS_DDL(BEGIN || p_proc_name ||; END;);
IF not FORMS_SUCCESS THEN
handle_server_error(DBMS_ERROR_CODE,DBMS_ERROR_TEXT);
END IF;
END;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-21
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Summary
......................................................................................................................................................
13-22
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
Oracle Database Server Features Useful for Form Builder
Declarative integrity constraints
Stored program units
Database triggers
DDL
Dealing with PL/SQL Code
Store PL/SQL code in
- Oracle server
- Library
- Form
Call PL/SQL code from
- Database trigger
- Form trigger
Application partitioning
Handling Errors Raised by the Oracle Database Server
Causes: Declarative constraints, database triggers, stored program units
Trap implicit-DML errors by using DBMS_ERROR_CODE and
DBMS_ERROR_TEXT in an On-Error trigger
Trap explicit DML errors and stored program unit errors by using
SQLCODE and SQLERRM in a WHEN OTHERS exception handler
Performing DDL with FORMS_DDL
Parameter is a string (less than or equal to 32 K) representing a PL/SQL
block or DML or DDL statement.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-23
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Practice 13 Overview
......................................................................................................................................................
13-24
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
13-25
Lesson
13: Using Server Features in Form Builder
......................................................................................................................................................
Practice 13
1 Create a stored procedure, and process error messages that it may
......................................................................................................................................................
13-26
Oracle iDS Forms: Build Internet Applications II
................................
Applying Timers
Lesson
14: Applying Timers
......................................................................................................................................................
Objectives
Describe timers
Create a timer
Modify a timer
Delete a timer
Handle timer expiration
Instructor Note
Topic
Lecture
Timing
20 minutes
Practice
25 minutes
Total
45 minutes
......................................................................................................................................................
14-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
This lesson covers time-initiated processing; that is, processing that occurs
after a certain amount of time has elapsed. The mechanism you use to do this
is called a timer and it is created, modified, and deleted at run time.
Objectives
After completing this lesson, you should be able to do the following:
Describe timers
Create a timer
Modify a timer
Delete a timer
Handle timer expiration
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-3
Lesson
14: Applying Timers
......................................................................................................................................................
Timers
What is a timer?
Built-ins for timers:
FIND_TIMER
CREATE_TIMER
SET_TIMER
DELETE_TIMER
GET_APPLICATION_PROPERTY
(TIMER_NAME)
Timers
When-Timer-Expired trigger
Using timers:
Poll database
Periodically query, commit, or rollback
Show About information at startup
Technical Note
Timers are not suitable means of shutting down an application. It is the job
of the operating system to recognize idle processes and shut them down.
......................................................................................................................................................
14-4
Oracle iDS Forms: Build Internet Applications II
Timers
......................................................................................................................................................
Timers
Forms typically processes events that are user initiated. You can use timers
when you want Forms to initiate actions after a specific time period time.
What Is a Timer?
A timer is a programmatic construct similar to an internal alarm clock.
You can create, modify, or delete timers with built-ins. When you create or
modify a timer, you can specify the time period for the timer. Using a
trigger, you can specify actions to be performed at the end of that period.
Built-in Functions for Timers
Built-in
FIND_TIMER
CREATE_TIMER
SET_TIMER
DELETE_TIMER
GET_APPLICATION_PROPERTY
Description
Returns the internal timer ID (of data type
TIMER) of a timer with the given name
Creates a timer with a given name, a defined time
interval, and whether the timer should repeat on
expiration.
Changes the settings for the given timer (You can
modify the time interval and the repeat behavior.)
Deletes the given timer
The TIMER_NAME property returns the name of
the most recently expired timer.
When-Timer-Expired Trigger
This trigger fires when the specified time interval of the timer has elapsed.
Uses of Timers
Polling the database to check if a certain event has occurred
Performing an automatic query at regular intervals
Showing About this... information at form startup
Performing automatic commits or rollbacks after a specified idle time
Web Design Tip
You should restrict the frequency of timers in Web-deployed forms in order
to reduce a potential increase in network traffic. Replacing timers with
JavaBeans, which provide similar functionality, will benefit users as code
would be executed on the Web client without invoking network traffic.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-5
Lesson
14: Applying Timers
......................................................................................................................................................
Timer B
created
Start
A
Timer A
expired
(R)
When-Timer-Expired (A)
Timer B
expired
Query
issued
B
B,A
Timer A
expired
(R)
Query
complete
When-Timer-Expired (B)
When-Timer-Expired (A)
Instructor Note
Explain that:
1 Timer A is created, and when it expires, it is placed in the timer queue.
2 If no other processing is taking place, then the When-Timer-Expired
trigger fires for Timer A.
3 After Timer A has been serviced from the queue, it can begin its next
iteration.
4 Timer B (a nonrepeating timer) is created in the meantime.
5 When Timer B expires, it cannot be immediately serviced by the
When-Timer-Expired trigger, because a query is taking place.
6 After the query is complete, the When-Timer-Expired trigger can fire for
Timer B.
Explanation: GET_APPLICATION_PROPERTY(timer_name) returns
NULL if called from any trigger other than When-Timer-Expired.
Demonstration: Use Customers.fmb to show the About...
information at startup. Use Autocmit.fmb to show the Auto Commit/
Rollback after a period of time.
......................................................................................................................................................
14-6
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-7
Lesson
14: Applying Timers
......................................................................................................................................................
Creating a Timer
Syntax:
CREATE_TIMER
CREATE_TIMER (timer_name,
(timer_name, milliseconds,
milliseconds, iterate)
iterate)
Example:
v_timer_id
v_timer_id :=
:= CREATE_TIMER
CREATE_TIMER ((hour_alarm,
hour_alarm, cst_hour);
cst_hour);
......................................................................................................................................................
14-8
Oracle iDS Forms: Build Internet Applications II
Creating a Timer
......................................................................................................................................................
Creating a Timer
You can create a timer by using the CREATE_TIMER built-in function,
which returns type TIMER.
Syntax
CREATE_TIMER(timer_name, milliseconds, iterate)
Parameter
timer_name
milliseconds
iterate
Description
The timer name
The duration of the timer in milliseconds (Value must be
between 1 and 2147483648, approximately 25 days.)
Specifies whether the timer should repeat upon expiration
(Valid values are REPEATthe defaultand NO_REPEAT.)
Example
At form startup, create a timer named HOUR_ALARM that expires every
hour.
DECLARE
cst_hour
constant NUMBER(7) := 3600000;
--3600000 is one hour in milliseconds
v_timer_id TIMER;
BEGIN
v_timer_id := CREATE_TIMER(hour_alarm, cst_hour);
END;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-9
Lesson
14: Applying Timers
......................................................................................................................................................
Modifying a Timer
Syntax:
SET_TIMER
SET_TIMER
SET_TIMER
SET_TIMER
(timer_name,
(timer_name, milliseconds,
milliseconds, iterate)
iterate)
(timer_id,
milliseconds,
(timer_id, milliseconds, iterate
iterate))
Example:
SET_TIMER
SET_TIMER ((hour_alarm,
hour_alarm, no_change,
no_change, no_repeat
no_repeat);
);
......................................................................................................................................................
14-10
Oracle iDS Forms: Build Internet Applications II
Modifying a Timer
......................................................................................................................................................
Modifying a Timer
You can modify a timer by using the SET_TIMER built-in procedure.
Syntax
SET_TIMER(timer_name, milliseconds, iterate)
SET_TIMER(timer_id, milliseconds, iterate)
Parameter
Description
timer_name
timer_id
milliseconds
iterate
Example
Set the repeat behavior of a timer named HOUR_ALARM without changing
the time interval. The trigger name depends on the situation.
BEGIN
SET_TIMER(hour_alarm, no_change, no_repeat);
END;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-11
Lesson
14: Applying Timers
......................................................................................................................................................
Deleting a Timer
Syntax:
DELETE_TIMER
DELETE_TIMER
DELETE_TIMER
DELETE_TIMER
(timer_name)
(timer_name)
(timer_id)
(timer_id)
Example:
...
...
IF
IF NOT
NOT ID_NULL
ID_NULL (FIND_TIMER
(FIND_TIMER ((hour_alarm
hour_alarm))
)) THEN
THEN
DELETE_TIMER
(hour_alarm);
DELETE_TIMER (hour_alarm);
END
END IF;
IF;
...
...
......................................................................................................................................................
14-12
Oracle iDS Forms: Build Internet Applications II
Deleting a Timer
......................................................................................................................................................
Deleting a Timer
You can delete a timer by using the DELETE_TIMER built-in procedure.
Syntax
DELETE_TIMER(timer_name)
DELETE_TIMER(timer_id)
Parameter
Description
timer_name
timer_id
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-13
Lesson
14: Applying Timers
......................................................................................................................................................
Summary
Summary
......................................................................................................................................................
14-14
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
A timer is a programmatic construct much like an internal alarm clock.
Built-ins for Timers
FIND_TIMER
CREATE_TIMER
SET_TIMER
DELETE_TIMER
GET_APPLICATION_PROPERTY(TIMER_NAME)
Uses of Timers
Polling the database to check if a certain event has occurred
Performing an automatic query at regular intervals
Showing About this... information at form startup
Performing an automatic commit or rollback after a specific amount of
idle time
Handling Timer Expiration
When a timer expires, it is put in a first-in-first-out timer queue.
The When-Timer-Expired trigger fires once for each timer that expires,
but only after Forms has completed any current processing.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-15
Lesson
14: Applying Timers
......................................................................................................................................................
Practice 14 Overview
......................................................................................................................................................
14-16
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
14-17
Lesson
14: Applying Timers
......................................................................................................................................................
Practice 14
1 Automatically ask the users if they want to commit after a set period of
time.
a Open your CUSTOMERS form module.
b At the startup of the form, create a global variable called
GLOBAL.LOCKS_PENDING. This will indicate at all times
whether rows of the S_CUSTOMER table are locked. The default
value is NULL. Append your new code to existing code.
c Create the On-Lock trigger to implement the default lock processing,
update the global variable, and create the timer. You can import the
code from the pr14_1.txt file.
d Display an alert if locks are still pending after a certain period of
time elapses. This alert should ask the user to commit or roll back the
changes. The alert, ASK_SAVE, already exists in your form. Define
an appropriate trigger. You can import the code from the
pr14_2.txt file.
e Create a Post-Database-Commit trigger to restore the NULL value to
the global variable. You can import the code from the pr14_3.txt
file.
f Create the On-Rollback trigger to implement the default rollback
processing and restore the NULL value to the global variable. You
can import the code from the pr14_4.txt file.
g Save and compile your form to test.
......................................................................................................................................................
14-18
Oracle iDS Forms: Build Internet Applications II
................................
Including Charts
and Reports
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Objectives
Instructor Note
Topic
Lecture
Timing
30 minutes
Practice
30 minutes
Total
60 minutes
......................................................................................................................................................
15-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
In this lesson, you will learn how to include charts and reports in your
application. You will also learn how to invoke additional document types
with Web-deployed forms.
Objectives
After completing this lesson, you should be able to do the following:
Include charts in an application
Include reports in an application
Integrate other documents with Web-deployed forms
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-3
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Use the
Chart tool
to drag a
chart area
onto
the canvas.
Instructor Note
Demonstration:
Step 1: Open the Employee Form (Emp.fmb)demonstration. Display the
CANVAS4 canvas. From the Layout Editor toolbar, change the Block popup list from EMP to CONTROL. Using the Chart tool, drag a chart area onto
the canvas. The Employee form is based on the EMP table. If it does not
already exist, it can be created by running the utlsample.sql file.
(Instructions for this demonstration continue in the next instructor note.)
......................................................................................................................................................
15-4
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-5
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Chart
type
Instructor Note
Step 2: Select Column for the chart type.
Step 3: Select the EMP block.
......................................................................................................................................................
15-6
Oracle iDS Forms: Build Internet Applications II
Chart Type
Select the style of chart that you require. The picture on the left of the wizard
displays the relevant chart style.
The chart subtype options are context-sensitive; the number and style of
options change depending on the chart type that you choose. Select the chart
subtype that you require, and then click Next to continue to the next wizard
page.
Chart Type
Description
Column
Bar
Pie
Line
Mixed
Data is charted using multiple chart types, such as bar and line.
Data Source
The next step in the Chart Wizard is to select the block that contains the data
you want to represent in the chart. The data block you select determines the
data that is available for assignment to the Category and Value axes of your
chart.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-7
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Arrow points to
the Value axis.
Instructor Note
Step 4: Select ENAME for the Category axis.
Step 5: Select SAL for the Value axis. Save into Disp1.ogd. Run your
form.
......................................................................................................................................................
15-8
Oracle iDS Forms: Build Internet Applications II
Category Axis
To use the Chart Wizard to map data to your charts Category (X) axis:
1 In the Available Fields list, select the field that you want to map to the
Category (X) axis of the chart.
2 Transfer the selected field from the Available Fields list to the Category
Axis list.
Chart Type
Description
Bar chart
Pie chart
Value Axis
To use the Chart Wizard to map data to your charts Value (Y) axis:
1 In the Available Fields list, select the field that you want to map to the
Value (Y) axis of the chart.
2 Transfer the selected field from the Available Fields list to the Value
Axis list.
Chart Type
Description
Bar chart
Pie chart
You must transfer at least one field from the Available Fields list to the
Category Value list before navigating to the next page.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-9
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Filename
Execution Mode
Communication Mode
Data Source Data Block
Query Name
Data Source X Axis
Data Source Y Axis
Update on Query
Update on Commit
Instructor Note
The default name of the Query Name property is Genie_Query. The query is
created automatically with the structure of the Data Source Data Block.
......................................................................................................................................................
15-10
Oracle iDS Forms: Build Internet Applications II
Description
Filename
Execution Mode
Communication Mode
Specifies the block that contains the data to represent in the chart
Query Name
Specifies the item name used to map data to the chart Category
(X) axis
Specifies the item name used to map data to the chart Value (Y)
axis
Update on Query
Update on Commit
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-11
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Technical Note
Passing data is applicable only if running against a local server.
Instructor Note
You cannot run a report based on a block that contains a long column.
Demonstration: Open customers.fmb to demonstrate the creation of a
new report object.
......................................................................................................................................................
15-12
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-13
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Filename
Filename
Execution
Execution Mode
Mode
Communication
Communication Mode
Mode
Data
Data Source
Source Data
Data Block
Block
Query
Query Name
Name
Reports properties
Instructor Note
Demonstration: Set the Execution Mode property to RUNTIME, the
Communication Mode to SYNCHRONOUS, and the Report Destination
Type to PREVIEW.
......................................................................................................................................................
15-14
Oracle iDS Forms: Build Internet Applications II
Description
Filename
Execution Mode
Communication Mode
Query Name
Reports Properties
Property Name
Description
Report Server
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-15
Lesson
15: Including Charts and Reports
......................................................................................................................................................
RUN_REPORT_OBJECT
FIND_REPORT_OBJECT
GET_REPORT_OBJECT_PROPERTY
SET_REPORT_OBJECT_PROPERTY
CANCEL_REPORT_OBJECT
COPY_REPORT_OUTPUT
REPORT_OBJECT_STATUS
RUN_PRODUCT
Instructor Note
With Web-deployed forms RUN_PRODUCT can be used to run and view
reports. However it requires specific environment variables to be defined.
These are explained in the Oracle 9iAS Forms Services: Deploy Internet
Applications course. It is recommended that RUN_REPORT_OBJECT is
used rather than RUN_PRODUCT.
......................................................................................................................................................
15-16
Oracle iDS Forms: Build Internet Applications II
Description
RUN_REPORT_OBJECT
FIND_REPORT_OBJECT
GET_REPORT_OBJECT_PROPERTY
SET_REPORT_OBJECT_PROPERTY
CANCEL_REPORT_OBJECT
COPY_REPORT_OUTPUT
REPORT_OBJECT_STATUS
RUN_PRODUCT
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-17
Lesson
15: Including Charts and Reports
......................................................................................................................................................
DECLARE
v_rep VARCHAR2(100);
repid REPORT_OBJECT;
BEGIN
repid := FIND_REPORT_OBJECT(deptrpt);
v_rep := RUN_REPORT_OBJECT(repid);
end;
. . .
repid := FIND_REPORT_OBJECT(barcode);
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
IF rep_status = FINISHED THEN
COPY_REPORT_OBJECT_OUTPUT(v_rep,c:\local.pdf);
HOST(netscape c:\local.pdf);
END IF;
. . .
Instructor Note
If you want to test the report status when you run a report against a remote
server, the Communication Mode report object property must be
synchronous.
......................................................................................................................................................
15-18
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-19
Lesson
15: Including Charts and Reports
......................................................................................................................................................
WEB.SHOW_DOCUMENT
WEB.SHOW_DOCUMENT(url,
WEB.SHOW_DOCUMENT(url, target);
target);
Example
my_url
my_url :=
:= http://www.summit.com/repts/emps.pdf;
http://www.summit.com/repts/emps.pdf;
WEB.SHOW_DOCUMENT(my_url,
WEB.SHOW_DOCUMENT(my_url, _SELF);
_SELF);
Instructor Note
Use SHOWURL.FMB to demonstrate WEB.SHOW_DOCUMENT.
You can demonstrate how to download a report, images, and a MS Word
document.
When you run the form, be sure to completely replace the contents of the
domain item (:http://.your domain name here) with your
current domain name (e.g., http://wwedf-196.us.oracle.com).
......................................................................................................................................................
15-20
Oracle iDS Forms: Build Internet Applications II
Value
File
HTML
HTMLCSS
PDF
XML
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-21
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Summary
Summary
......................................................................................................................................................
15-22
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
In this lesson, you should have learned how to include charts and reports in
your application. You should have learned how to invoke the Chart Wizard.
Reporting Features in Form Builder
Create report objects
Base reports on data blocks
Run against local or remote server
Run reports from Web-deployed forms
Interacting with Reports
RUN_REPORT_OBJECT
FIND_REPORT_OBJECT
CANCEL_REPORT_OBJECT
REPORT_OBJECT_STATUS
COPY_REPORT_OUTPUT
GET_REPORT_OBJECT_PROPERTY
SET_REPORT_OBJECT_PROPERTY
WEB.SHOW_DOCUMENT
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-23
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Practice 15 Overview
......................................................................................................................................................
15-24
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-25
Lesson
15: Including Charts and Reports
......................................................................................................................................................
Practice 15
1 Create a chart object by using the Chart Wizard. This chart should
displays a customer list using a tabular layout. Display only the ID,
NAME, COUNTRY, and REGION_ID fields.
a Open the CUSTREPT form. Save as CUSTREPXX where XX is your
student course number. Create a new report object.
This will invoke Report Builder. Within the Report Wizard:
Choose the report style Tabular.
Select the ID, NAME, COUNTRY, and REGION_ID fields.
Do not select fields to total.
Change labels and widths for your fields.
Select a template for your report.
b Save your report and exit Report Builder.
c Set the Execution Mode report object property to runtime and the
Report Destination Type report object property to screen. Rename
the report object to my_report.
d Create a button named CUST_REP_BUTTON in the control block.
Display this button on the CANVAS2 canvas.
......................................................................................................................................................
15-26
Oracle iDS Forms: Build Internet Applications II
Practice 15
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
15-27
Lesson
15: Including Charts and Reports
......................................................................................................................................................
......................................................................................................................................................
15-28
Oracle iDS Forms: Build Internet Applications II
................................
Practice Solutions
Appendix
A: Practice Solutions
......................................................................................................................................................
Practice 1 Solutions
1 Create a new menu module.
a
Select the Menus node in the Object Navigator and click the
Create tool.
Invoke the Menu Editor.
This automatically creates the main menu.
Change the name of the menu to MAIN_MENU.
Rename the menu item New Item to File. Click New Item twice
to obtain the text cursor. Erase the old name. Enter the name
File.
Create new menu items under File. Click File. Click the Create
Down tool. Change the name.
......................................................................................................................................................
A-2
Oracle iDS Forms: Build Internet Applications II
Practice 1 Solutions
......................................................................................................................................................
Visible in
Horiz.
Menu
Toolbar
Icon
Filename
DO_KEY(CO
MMIT_FORM
);
Yes
Yes
Save
DO_KEY(
CLEAR_FORM
);
Yes
Yes
Abort
Yes
Yes
Yes
Yes
No
Yes
Label
Menu
Item
Type
Command
Type
Menu Item
Code
Save
Plain
PL/SQL
Clear
Plain
PL/SQL
Null1
Separator
Null
Exit
Plain
PL/SQL
Null2
Separator
Null
DO_KEY(
EXIT_FORM
);
Exit
Note the exact names of the Main Menu, and each of its menu
items. These will be needed in a later exercise.
Create a new menu item to the right of File and rename it Edit.
Click the File menu item.
Click the Create Right tool.
Name the new menu item Edit.
Create new menu items under Edit. Click Edit. Click the Create
Down tool. Change the name.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-3
Appendix
A: Practice Solutions
......................................................................................................................................................
Label
Menu
Item Type
Magic
Item
Command
Type
Visible
in Menu
Visible in
Horiz. Menu
Toolbar
Icon
Filename
Cut
Magic
Cut
Null
Yes
Yes
Cut
Copy
Magic
Copy
Null
Yes
Yes
Copy
Paste
Magic
Paste
Null
Yes
Yes
Paste
Null3
Separator
Null
No
Yes
Create a new menu item to the right of Edit and rename it Sort
By. Click Edit. Click the Create Right tool. Rename the new
menu item Sort By.
- Create three new menu items under Sort By. Click Sort By. Click
the Create Down tool. Change the name. Set additional
properties as follows:
Sort By Menu
Menu Label
Menu
Item
Type
Menu Item
Radio
Group
Command
Type
Order Id
Radio
Order_By
PL/SQL
SET_BLOCK_PROPERTY(
s_ord, order_by,
id ) ;
Customer Id
Radio
Order_By
PL/SQL
SET_BLOCK_PROPERTY(
s_ord, order_by,
customer_id ) ;
Sales Rep Id
Radio
Order_By
PL/SQL
SET_BLOCK_PROPERTY(
s_ord, order_by,
sales_rep_id ) ;
......................................................................................................................................................
A-4
Oracle iDS Forms: Build Internet Applications II
Practice 1 Solutions
......................................................................................................................................................
Icon
Filename
Menu
Item Type
Command
Type
Enter
Query
Plain
PL/SQL
DO_KEY(
ENTER_QUERY);
Yes
query
eXecute
Query
Plain
PL/SQL
DO_KEY(EXECUT
E_QUERY);
Yes
execute
Label
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-5
Appendix
A: Practice Solutions
......................................................................................................................................................
Practice 2 Solutions
1 Define a check menu item.
a
Open your M_SUMMIT menu module and add a new menu item to
the Sort By menu; name it Display_Help.
See previous solution.
Set the properties as follows:
Menu Label
Command Type
Display Help
Check
PL/SQL
......................................................................................................................................................
A-6
Oracle iDS Forms: Build Internet Applications II
Practice 2 Solutions
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-7
Appendix
A: Practice Solutions
......................................................................................................................................................
4 With both the ORDERS and CUSTOMERS form modules, restore the default
menu, (DEFAULT&SMARTBAR).
......................................................................................................................................................
A-8
Oracle iDS Forms: Build Internet Applications II
Practice 3 Solutions
......................................................................................................................................................
Practice 3 Solutions
1 Maintain consistent functionality in your form module by using key
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-9
Appendix
A: Practice Solutions
......................................................................................................................................................
......................................................................................................................................................
A-10
Oracle iDS Forms: Build Internet Applications II
Practice 4 Solutions
......................................................................................................................................................
Practice 4 Solutions
In this practice, you provide additional functionality in your forms by
defining mouse event triggers.
1 In your CUSTOMERS form, define a mouse event trigger on
S_CUSTOMER.COMMENTS that invokes the items editor when the
user double-clicks the item.
- When-Mouse-Doubleclick on s_customer.comments
Edit_TextItem;
2 In your ORDERS form change the mouse cursor symbol to busy while
the HELP canvas is displayed.
a Ensure that the default symbol is restored whenever the user hides
the HELP canvas.
- When-Button-Pressed on :control.showhelp
Set_Application_Property(cursor_style,help);
When-Button-Pressed on :control.hidehelp
Set_Application_Property(cursor_style,normal);
The user can close the HELP canvas without pressing the
HIDEHELP button, by navigating to an item in another block. How
can you ensure that the mouse cursor is always restored?
- Define a Post-Block trigger for the Control Data block.
Copy the code to restore the mouse cursor from your
:Control.hidehelp button When-Button-Pressed trigger.
c Save and compile your form modules. Deploy your forms to the Web
to test.You can call the ORDERS form from your CUSTOMERS
form.
b
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-11
Appendix
A: Practice Solutions
......................................................................................................................................................
Practice 5 Solutions
1 Manipulate a multiple-window form.
In your ORDERS form module, ensure that the form is exited when a
user closes the orders window using the window system menu box.
An alert should be displayed to users asking them to confirm that
they wish to leave the application.
- Define a When-Window-Closed trigger at Form Level.
- Call the do_key built-in to execute [Exit_Form].
b If a user closes the Inventory window through the system menu box,
ensure that the form remains open with the cursor positioned in the
Orders window.
- In the When-Window-Closed trigger, use :system.event_window
to identify the current window:
If :system.event_window = WIN_ORDER then
do_key(exit_form);
else
go_block(s_ord);
end if;
c Whenever the user navigates between the order and inventory
windows, place the cursor in the first navigable item within the
current window.
- Define a When-Window-Activated trigger at form level. Use
:system.event_window to identify the current window, and use
the GO_BLOCK built in to enforce navigation within the
appropriate window.
d Save and compile your form. Deploy your form to the Web to test.
2 In your CUSTOMERS form module, define triggers to manage tab page
navigation.
a Using an appropriate trigger, disable the COMMENTS tab page
whenever the COMMENTS item contains no text.
b The trigger should fire whenever the user navigates to another
record.
a
......................................................................................................................................................
A-12
Oracle iDS Forms: Build Internet Applications II
Practice 5 Solutions
......................................................................................................................................................
Whenever the user moves from one tab page to another, ensure that
the mouse cursor is placed in the first navigable field within the
page.
- Define a WHEN-TAB-PAGE-CHANGED trigger. Identify the
current tab page with the :system.tab_new_page system
variable. Use the GO_ITEM built-in to place the cursor in the
first navigable field.
Begin
if :SYSTEM.tab_new_page = ADDRESS
then GO_ITEM(s_customer.name);
else if :SYSTEM.tab_new_page = BILLING
then GO_ITEM(s_customer.credit_rating);
else GO_ITEM(s_customer.comments);
end if;
end if;
End;
d Save and compile your form. Deploy your form to the Web to test.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-13
Appendix
A: Practice Solutions
......................................................................................................................................................
......................................................................................................................................................
A-14
Oracle iDS Forms: Build Internet Applications II
Practice 6 Solutions
......................................................................................................................................................
Practice 6 Solutions
1 Create a server-side package containing a procedure to return a REF
cursor.
a Create the Orders_pkg package specification; you can import the
code from the pr6_1.txt file.
b Create the Orders_pkg package body; you can import the code from
the pr6_2.txt file.
- Use the Stored Procedure editor in Forms and import the code
from the files.
c Examine the Orders_pkg package body to identify required
parameter values.
- A value of P,C or S is passed to the REF cursor to determine
which query is required. The REF cursor can query on either
products, customers, or sales reps.
2 Open the ORDERREFCURSOR.fmb file and save as ORDREFXX where
XX is your student course number. This form contains a control block,
called CHOOSE, and a group of option buttons which allows the user to
specify a parameter value to be passed to the REF cursor.
a Create a data block called SELECTION and base it on the REF
cursor procedure that you have just created.
- Use the Data Block Wizard and select Stored Procedures for
data block type.
- Specify full procedure name:
orders_pkg.query_proc
- Press the Refresh button. Available columns will be displayed.
- Select all as Database Items.
b Pass the name of the radio group as the value for the P_VIEW
argument: :choose.view_type.
- For the P_VIEW argument, set the value to
:choose.view_type
- Select Finish to end the wizard.
c In the layout editor, customize the canvas layout to ensure that
SELECTION items are displayed to the left of the option buttons
group.
d Save and compile your form. Deploy your form to the Web to test.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-15
Appendix
A: Practice Solutions
......................................................................................................................................................
Practice 7 Solutions
1 Create a data block based on a relational table with an object column.
......................................................................................................................................................
A-16
Oracle iDS Forms: Build Internet Applications II
Practice 7 Solutions
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-17
Appendix
A: Practice Solutions
......................................................................................................................................................
Practice 8 Solutions
1 Open your ORDERS form and examine the properties of the relation
called S_ORD_S_ITEM.
a Note the deletion and coordination property values.
b Run the ORDERS form and test the way deletes are handled.
2 Implement a query coordination-type toggle.
a Add two check boxes to the control block with the following
properties:
Property
Check Box 1
Check Box 2
Name
IMMEDIATE
AUTO_QUERY
Enabled
Yes
No
Label
Immediate
Auto Query
CHECKED
UNCHECKED
Keyboard Navigable
No
No
Mouse Navigate
No
No
Data Type
CHAR
CHAR
Initial Value
DataBase Item
No
No
Canvas
TOOLBAR
TOOLBAR
......................................................................................................................................................
A-18
Oracle iDS Forms: Build Internet Applications II
Practice 8 Solutions
......................................................................................................................................................
If GET_RELATION_PROPERTY( s_ord_s_item,
DEFERRED_COORDINATION )
= FALSE Then
SET_RELATION_PROPERTY(s_ord_s_item,
DEFERRED_COORDINATION,
PROPERTY_TRUE);
SET_ITEM_PROPERTY(control.auto_query,
ENABLED,
PROPERTY_TRUE );
Else
SET_RELATION_PROPERTY(s_ord_s_item,
DEFERRED_COORDINATION,
PROPERTY_FALSE);
SET_ITEM_PROPERTY(control.auto_query,
ENABLED,
PROPERTY_FALSE );
End If;
Make sure that the second check box enables a user to toggle
between automatic query and no automatic query for the detail
block. This check box should be disabled if the other check box
indicates immediate coordination. You can import the code from the
pr8_2.txt file.
- When-Checkbox-Changed on CONTROL.AUTO_QUERY
If GET_RELATION_PROPERTY(s_ord_s_item,
AUTOQUERY ) = FALSE Then
SET_RELATION_PROPERTY(s_ord_s_item,
AUTOQUERY, PROPERTY_TRUE );
Else
SET_RELATION_PROPERTY(s_ord_s_item,
AUTOQUERY, PROPERTY_FALSE);
End If;
e Save, compile, and test your form.
d
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-19
Appendix
A: Practice Solutions
......................................................................................................................................................
......................................................................................................................................................
A-20
Oracle iDS Forms: Build Internet Applications II
Practice 9 Solutions
......................................................................................................................................................
Practice 9 Solutions
1 Create a multiple-form application by linking the CUSTOMERS and the
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-21
Appendix
A: Practice Solutions
......................................................................................................................................................
In the SALESREP form, ensure that whenever the form has been
opened by CALL_FORM, that a [Commit Form] performs a POST.
- In a KEY-COMMIT trigger, define the following code:
If get_application_property(calling_form)
is not null then
post;
else
commit_form;
end if;
c Ensure that updates in SALESREP are not cleared when the user
exits the form.
- SALESREP form KEY-EXIT trigger
If get_application_property(calling_form)
is not null then
exit_form(do_commit,no_rollback);
else
exit_form;
end if;
d Save and compile your form. Deploy your form to the Web to test.
b
......................................................................................................................................................
A-22
Oracle iDS Forms: Build Internet Applications II
Practice 9 Solutions
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-23
Appendix
A: Practice Solutions
......................................................................................................................................................
Practice 10 Solutions
1 Create a dynamic list item populated from a design-time query record
group. The record group will hold region ID and the name of the
departments in the S_DEPT table.
a Open the Employees form. Save as EmpXX where XX is your student
course number. In the Object Navigator, create a record group named
DEPT_ID based on the query below:
SELECT name || in region ||
TO_CHAR(region_id) Name,
TO_CHAR(id) Id
FROM
s_dept
UNION
SELECT none Name, 0 Id from dual
ORDER BY 1
Convert the text item DEPT_ID into a list item, with a Poplist style.
Resize the list item in the Layout Editor.
c Create one element in the list item. Specify a label of Dummy and a
value of 0. Set the Mapping of Other Values property to 0.
d Create a procedure called POPULATE_DEPT_LIST. This procedure
will accept the list item name as an argument and populate the list
item dynamically at run time, using the design-time query record
group.
You can import the code from the pr10_1.txt file.
- Procedure Populate_Dept_List
p_list_item in varchar2) is
cst_rg_nom constant varchar2( 30 ) :=
Get_Item_Property(p_list_item,
Item_Name );
Begin
If Populate_Group( cst_rg_nom ) = 0 then
Populate_List( p_list_item, cst_rg_nom );
End If;
Copy(Get_List_Element_Value( p_list_item,1),
p_list_item);
End;
......................................................................................................................................................
A-24
Oracle iDS Forms: Build Internet Applications II
Practice 10 Solutions
......................................................................................................................................................
FROM
UNION
SELECT
none Name, TO_CHAR(0) Id
FROM
dual
ORDER BY 1
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-25
Appendix
A: Practice Solutions
......................................................................................................................................................
Select name||to_char(region_id),
to_char(id)
from
s_dept
UNION
Select none Name, to_char(0) Id
from dual
order by 1');
end if;
v_error := populate_group(v_rg_id);
populate_list('s_emp.dept_id',v_rg_id);
Copy(Get_List_Element_Value('s_emp.dept_id',
1), 's_emp.dept_id');
End;
e Call the procedure from the When-Create-Record trigger.
- When-Create-Record Trigger on the S_EMP Block:
Create_Dept_List;
f Compile and save your form module. Test.
......................................................................................................................................................
A-26
Oracle iDS Forms: Build Internet Applications II
Practice 11 Solutions
......................................................................................................................................................
Practice 11 Solutions
1 Create a picklist by using the picklist class. This picklist enables the end
user to select order items from a product list, and to place selections in a
second list.
a Create a new form module, called PICKXX where XX is your student
course number. Open the Form_Builder_II.olb object
library. This library contains form objects and code for the picklist.
Copy the PICKLIST_BASIC object group to your form module.
Copy the PICKLIST object group into your new form module.
b Ensure the CONTROL block is the last defined data block in the
Object Navigator.
c Attach the picklist.pll library. This contains the functions
and procedures required for creating the picklist.
d Define a When-New-Form-Instance trigger which will create and
populate the picklist. You can import the code from the
pr11_1.txt file.
- Declare
dummy number;
Begin
Default_Value(Y,Global.where_cls);
pick_list.create_picklist;
if :GLOBAL.where_cls = Y then
dummy := pick_list.populate_picklist_with_query(
pick_list.list_in, select name, id from
s_product order by 1);
else
dummy := pick_list.populate_picklist_with_query(
pick_list.list_in, select name, id from
s_product where || :GLOBAL.where_cls || order
by 1);
end if;
pick_list.set_picklist_selection(
pick_list.list_in,1,null);
pick_list.display_picklist(pick_list.list_in);
pick_list.display_picklist(pick_list.list_out);
End;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-27
Appendix
A: Practice Solutions
......................................................................................................................................................
......................................................................................................................................................
A-28
Oracle iDS Forms: Build Internet Applications II
Practice 11 Solutions
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-29
Appendix
A: Practice Solutions
......................................................................................................................................................
Practice 12 Solutions
1 Provide an alternative user interface for your Web-deployed forms by
......................................................................................................................................................
A-30
Oracle iDS Forms: Build Internet Applications II
Practice 12 Solutions
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-31
Appendix
A: Practice Solutions
......................................................................................................................................................
Create two text items, URL and LABEL, in the Data Block
LINK.
Save and compile your form. Deploy your form to the Web to test.
......................................................................................................................................................
A-32
Oracle iDS Forms: Build Internet Applications II
Practice 13 Solutions
......................................................................................................................................................
Practice 13 Solutions
1 Create a stored procedure, and process error messages that may be
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-33
Appendix
A: Practice Solutions
......................................................................................................................................................
......................................................................................................................................................
A-34
Oracle iDS Forms: Build Internet Applications II
Practice 14 Solutions
......................................................................................................................................................
Practice 14 Solutions
1 Automatically ask the users if they want to commit after a set period of
time.
a Open your CUSTOMERS form module.
b At the startup of the form, create a global variable called
GLOBAL.LOCKS_PENDING. This will indicate at all times
whether rows of the S_CUSTOMER table are locked.
The default value is NULL. Append your new code to existing code.
- When-New-Form-Instance Trigger at Form Level
...
Default_Value( NULL, GLOBAL.locks_pending);
Create the On-Lock trigger to implement the default lock processing,
update the global variable, and create the timer. You can import the
code from the pr14_1.txt file.
- On-Lock Trigger at Form Level
Declare
timer_id TIMER;
Begin
LOCK_RECORD;
If FORM_SUCCESS then
If :GLOBAL.locks_pending IS NULL then
:GLOBAL.locks_pending := TRUE;
timer_id := CREATE_TIMER( locks,
5000 );
End If;
Else
Raise Form_Trigger_Failure;
End If;
End;
d Display an alert if locks are still pending after a certain period of
time elapses. This alert should ask the user to commit or roll back the
changes. The alert, ASK_SAVE, already exists in your form. Define
an appropriate trigger. You can import the code from the
pr14_2.txt file.
c
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-35
Appendix
A: Practice Solutions
......................................................................................................................................................
......................................................................................................................................................
A-36
Oracle iDS Forms: Build Internet Applications II
Practice 15 Solutions
......................................................................................................................................................
Practice 15 Solutions
1 Create a chart object by using the Chart Wizard. This chart should
displays a customer list using a tabular layout. Display only the ID,
NAME, COUNTRY, and REGION_ID fields.
a Open the CUSTREPT form. Save as CUSTREPXX where XX is your
student course number.Create a new report object.
- Select the Reports node in the Object Navigator.
- Click the Create icon.
- Specify a filename of myreport and a block name.
Click OK.
b This will invoke Report Builder. Within the Report Wizard:
Choose the report style Tabular.
Select the ID, NAME, COUNTRY, and REGION_ID fields.
Do not select fields to total.
Change labels and widths for your fields.
Select a template for your report.
c Save your report and exit Report Builder.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
A-37
Appendix
A: Practice Solutions
......................................................................................................................................................
Set the Execution Mode report object property to runtime and the
Report Destination Type report object property to screen. Rename
the report object to my_report.
- Display the Property Palette for the report object.
- Select Execution Mode and change the value to RUNTIME.
- Select Report Destination Type and change the value to
SCREEN.
e Create a button named CUST_REP_BUTTON in the control block.
Display this button on the CANVAS2 canvas.
f Create a When-Button-Pressed trigger on the
CUST_REP_BUTTON button to run the report.
- DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
BEGIN
repid := FIND_REPORT_OBJECT(my_report);
v_rep := RUN_REPORT_OBJECT(repid);
END;
g Change the Query All Record property value to Yes for the
S_CUSTOMER block.
h Save and compile your form module. Deploy your form to the Web
to test. Query a customer record before calling the report.
d
......................................................................................................................................................
A-38
Oracle iDS Forms: Build Internet Applications II
................................
Table Descriptions
and Data
ID
S_ITEM
PRODUCT_ID
S_ORD
CUSTOMER_ID
SALES_REP_ID
S_INVENTORY
PRODUCT_ID
ID
ID
ID
S_CUSTOMER
S_PRODUCT
SALES_REP_ID
IMAGE_ID
ID
S_IMAGE
ID
ID
S_EMP
DEPT_ID
ID
S_DEPT
*Unique occurrences are identified by PRODUCT_ID and
WAREHOUSE_ID.
......................................................................................................................................................
B-2
Oracle iDS Forms: Build Internet Applications II
S_CUSTOMER Description
.....................................................................................................................................................
S_CUSTOMER Description
Column Name
-------------- --------ID
NAME
PHONE
ADDRESS
CITY
STATE
COUNTRY
ZIP_CODE
CREDIT_RATING
SALES_REP_ID
REGION_ID
COMMENTS
Null?
------------NOT NULL
NOT NULL
Datatype
----------------NUMBER(7)
VARCHAR2(50)
VARCHAR2(25)
VARCHAR2(400)
VARCHAR2(30)
VARCHAR2(20)
VARCHAR2(30)
VARCHAR2(75)
VARCHAR2(9)
NUMBER(7)
NUMBER(7)
VARCHAR2(255)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-3
S_CUSTOMER Data
SQL> SELECT * FROM s_customer;
Id
Name
Phone
Address
----------------------- ------------ ----------City
State
Country
------------------ -------------------------Zip_code
Credit_ra
Sales_rep_id Region_id
----------------------------- --------Comments
-------------------------------------------------201
Unisports
55-2066101
72 Via Bahia
Sao Paolo
Brazil
Excellent
12
2
Customer usually orders large amounts and has a high order
total. This is okay as long as the credit rating remains
excellent.
202
Osaka
Oj Athletics
81-20101
......................................................................................................................................................
B-4
Oracle iDS Forms: Build Internet Applications II
S_CUSTOMER Data
.....................................................................................................................................................
Id
Name
Phone
Address
----------------------- ------------ ----------City
State
Country
------------------ -------------------------Zip_code
Credit_ra
Sales_rep_id Region_id
----------------------------- --------Comments
-------------------------------------------------204
Womansport
1-206-104-0103 281 King Street
Seattle
Washington
USA
98101
EXCELLENT
11
1
205
Hong Kong
206
Cannes
Sportique
33-2257201
234-603620
6 Saint Antoine
Nigeria
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-5
Id
Name
Phone
Address
----------------------- ------------ ----------City
State
Country
------------------ -------------------------Zip_code
Credit_ra
Sales_rep_id Region_id
----------------------------- --------Comments
-------------------------------------------------208
Muench Sports
49-527454
435 Gruenestrasse
Stuttgart
Germany
GOOD
15
5
Customer usually pays small orders by cash and large orders on
credit.
209
Beisbol Si!
San Pedro de Macons
EXCELLENT
809-352689
11
210
Futbol Sonora
52-404562
3 Via Saguaro
Nogales
EXCELLENT
12
2
Customer is difficult to reach by phone. Try mail.
211
Prague
Kuhns Sports
EXCELLENT
42-111292
15
7 Modrany
Czechoslovakia
5
......................................................................................................................................................
B-6
Oracle iDS Forms: Build Internet Applications II
S_CUSTOMER Data
.....................................................................................................................................................
Id
Name
Phone
Address
----------------------- ------------ ----------City
State
Country
------------------ -------------------------Zip_code
Credit_ra
Sales_rep_id Region_id
----------------------------- --------Comments
-------------------------------------------------212
Hamada Sport
20-1209211
57A Corniche
Alexandria
Egypt
EXCELLENT
13
3
Customer orders sea and water equipment.
213
Big Johns Sports
1-415-555-6281 4783 18th Street
Emporium
San Francisco
CA
USA
94117
EXCELLENT
11
1
Customer has a dependable credit record.
214
Ojibway Retail
Buffalo
NY
14202
POOR
215
Sporta Russia
7-3892456
6000 Yekatamina
St. Petersburg
Russia
POOR
15
5
This customer is very friendly, but has difficulty paying bills.
Insist upon cash.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-7
Null?
------------NOT NULL
NOT NULL
Datatype
-------------NUMBER(7)
VARCHAR2(25)
NUMBER(7)
NAME
---------------Finance
Sales
Sales
Sales
Sales
Sales
Operations
Operations
Operations
Operations
Operations
Administration
REGION_ID
----------------1
1
2
3
4
5
1
2
3
4
5
1
12 rows selected.
......................................................................................................................................................
B-8
Oracle iDS Forms: Build Internet Applications II
S_EMP Description
.....................................................................................................................................................
S_EMP Description
Column Name
-----------------------ID
LAST_NAME
FIRST_NAME
USERID
START_DATE
COMMENT
MANAGER_ID
TITLE
DEPT_ID
SALARY
COMMISSION_PCT
Null?
-------------NOT NULL
NOT NULL
Datatype
-------------NUMBER(7)
VARCHAR2(25)
VARCHAR2(25)
VARCHAR2(8)
DATE
VARCHAR2(255)
NUMBER(7)
VARCHAR2(25)
NUMBER(7)
NUMBER(11,2)
NUMBER(4,2)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-9
S_EMP Data
SQL> SELECT * FROM s_emp;
ID LAST_NAME
FIRST_NAME
USERID
START_DAT
---- ----------------- ----------------------- --------COMMENTS
-------------------------------------------------------------MANAGER_ID TITLE
DEPT_ID SALARY
---------- ---------------------------------- -----COMMISSION_PCT
--------------1 Velasquez
Carmen
cvelasqu 03-MAR-90
President
50 2500
2 Ngao
LaDoris
lngao
08-MAR-90
1 VP, Operations
41
1450
3
Nagayama
1 VP, Sales
Quick-To-See
Mark
1 VP, Finance
mquickto 07-APR-90
10
1450
Ropeburn
Audry
1 VP, Administration
aropebur 04-MAR-90
50
1550
Urguhart
Molly
2 Warehouse Manager
murguhar 18-JAN-91
41
1200
Menchu
Roberta
2 Warehouse Manager
Biri
Ben
2 Warehouse Manager
rmenchu 14-MAY-90
42
1250
bbiri
07-APR-90
43
1100
Catchpole
Antoinette
2 Warehouse Manager
acatchpo 09-FEB-92
44
1300
Midori
mnagayam 17-JUN-91
31
1400
......................................................................................................................................................
B-10
Oracle iDS Forms: Build Internet Applications II
S_EMP Data
.....................................................................................................................................................
ID LAST_NAME
FIRST_NAME
USERID
START_DAT
---- ----------------- ----------------------- --------COMMENTS
-------------------------------------------------------------MANAGER_ID TITLE
DEPT_ID SALARY
---------- ---------------------------------- -----COMMISSION_PCT
--------------10 Havel
Marta
mhavel
27-FEB-91
2 Warehouse Manager
45
1307
11 Magee
Colin
3 Sales Representative
10
cmagee
14-MAY-90
31
1400
12 Giljum
Henry
3 Sales Representative
12.5
hgiljum 18-JAN-92
32
1490
13 Sedeghi
Yasmin
3 Sales Representative
10
ysedeghi 18-FEB-91
33
1515
14 Nguyen
Mai
3 Sales Representative
15
mnguyen 22-JAN-92
34
1525
15 Dumas
Andre
3 Sales Representative
17.5
adumas
09-OCT-91
35
1450
16 Maduro
Elena
6 Stock Clerk
emaduro 07-FEB-92
41
1400
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-11
ID LAST_NAME
FIRST_NAME
USERID
START_DAT
---- ----------------- ----------------------- --------COMMENTS
-------------------------------------------------------------MANAGER_ID TITLE
DEPT_ID SALARY
---------- ---------------------------------- -----COMMISSION_PCT
--------------17 Smith
George
gsmith
08-MAR-90
6 Stock Clerk
41
940
18 Nozaki
Akira
7 Stock Clerk
anozaki 09-FEB-91
42
1200
19 Patel
Vikram
7 Stock Clerk
vpatel
06-AUG-91
42
795
20 Newman
Chad
8 Stock Clerk
cnewman 21-JUL-91
43
750
21 Markarian
Alexander
8 Stock Clerk
amarkari 26-MAY-91
43
850
22 Chang
Eddie
9 Stock Clerk
echang
30-NOV-90
44
800
23 Patel
Radha
9 Stock Clerk
rpatel
17-OCT-90
34
795
24 Dancs
Bela
10 Stock Clerk
bdancs
17-MAR-91
45
860
25 Schwartz
Sylvie
10 Stock Clerk
sschwart 09-MAY-91
45
1100
S_ITEM Description
.....................................................................................................................................................
S_ITEM Description
Column Name
------------------------ORD_ID
ITEM_ID
PRODUCT_ID
PRICE
QUANTITY
QUANTITY_SHIPPED
Null?
-------------NOT NULL
NOT NULL
NOT NULL
Datatype
---------NUMBER(7)
NUMBER(7)
NUMBER(7)
NUMBER(11,2)
NUMBER(9)
NUMBER(9)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-13
S_ITEM Data
SQL> SELECT * FROM s_item;
ORD_ID
-----100
100
100
100
100
100
100
101
101
101
101
101
101
101
102
102
103
103
104
104
104
104
105
105
105
ITEM_ID
-------1
2
3
5
7
6
4
1
3
5
6
7
4
2
1
2
1
2
1
4
2
3
1
3
2
PRODUCT_ID
----------10011
10013
10021
30326
41010
30433
10023
30421
41010
50169
50417
50530
41100
40422
20108
202011
30433
32779
20510
30421
20512
30321
50273
50532
50419
......................................................................................................................................................
B-14
Oracle iDS Forms: Build Internet Applications II
S_ITEM Data
.....................................................................................................................................................
ORD_ID
------106
106
106
106
106
106
107
107
107
107
107
108
108
108
108
108
108
108
109
109
109
109
109
109
109
110
110
111
111
97
97
98
99
99
99
99
ITEM_ID
------1
4
5
6
2
3
1
3
5
4
2
1
6
7
5
2
4
3
1
5
7
6
4
2
3
1
2
1
2
1
2
1
1
2
3
4
PRODUCT_ID
----------20108
50273
50418
50419
20201
50169
20106
20201
30421
30321
20108
20510
41080
41100
32861
20512
32779
30321
10011
30426
50418
32861
30326
10012
10022
50273
50536
40421
41080
20106
303211
404218
20510
20512
50417
50530
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-15
Null?
-----NOT NULL
NOT NULL
Datatype
--------------------NUMBER(7)
NUMBER(7)
DATE
DATE
NUMBER(7)
NUMBER(11,2)
VARCHAR2(6)
VARCHAR2(1)
DATE_ORDE
DATE_SHIPSALES_REP_IDTOTAL PAYMEN
ORDER_F
--- -----------
---------
----------------------------------
------
100
101
102
103
104
105
106
107
108
109
110
111
97
98
99
112
31-AUG92
31-AUG-92
01-SEP-92
02-SEP-92
03-SEP-92
04-SEP-92
07-SEP-92
07-SEP-92
07-SEP-92
08-SEP-92
09-SEP-92
09-SEP-92
28-AUG-92
31-AUG-92
31-AUG-92
31-AUG-92
10-SEP-9211
15-SEP-9214
08-SEP-9215
22-SEP-9215
23-SEP-9215
18-SEP-9211
15-SEP-9212
21-SEP-9215
10-SEP-9213
28-SEP-9211
21-SEP-9211
21-SEP-9211
17-SEP-9212
10-SEP-9214
18-SEP-9214
10-SEP-9212
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
204
205
206
208
208
209
210
211
212
213
214
204
201
202
203
210
601100
8056.6
8335
377
32430
2722.24
15634
142171
149570
1020935
1539.13
2770
84000
595
7707
550
CREDIT
CREDIT
CREDIT
CASH
CREDIT
CREDIT
CREDIT
CREDIT
CREDIT
CREDIT
CASH
CASH
CREDIT
CASH
CREDIT
CREDIT
16 rows selected.
......................................................................................................................................................
B-16
Oracle iDS Forms: Build Internet Applications II
S_PRODUCT Description
.....................................................................................................................................................
S_PRODUCT Description
Column Name
Null?
---------------------------------ID NOT NULL
NAMENOT NULL
SHORT_DESC
LONGTEXT_ID
IMAGE_ID
SUGGESTED_WHLSL_PRICE
WHLSL_UNITS
Datatype
----------------NUMBER(7)
VARCHAR2(50)
VARCHAR2(255)
NUMBER(7)
NUMBER(7)
NUMBER(11,2)
VARCHAR2(25)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-17
S_PRODUCT Data
SQL> SELECT * FROM s_product;
ID
---IMAGE_ID
-------10011
1001
NAME
SHORT_DESC
LONGTEXT_ID
-----------------------------------SUGGESTED_WHLSL_PRICEWHLSL_UNITS
-------------------------------Boot
Beginners ski boot 518
150
10012
1002
10013
1003
10021
1011
10022
1012
10023
1013
20106
520
530
20108
20201
708
......................................................................................................................................................
B-18
Oracle iDS Forms: Build Internet Applications II
S_PRODUCT Data
.....................................................................................................................................................
ID
NAME
SHORT_DESC
LONGTEXT_ID
---- --------------------------------------IMAGE_IDSUGGESTED_WHLSL_PRICEWHLSL_UNITS
---------------------------------------20510 Black Hawk Knee pads, pair
1017
Knee Pads
9
20512Black Hawk Elbow pads, pair
Elbow Pads 8
1019
940
1286
1368
928
929
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-19
ID
---IMAGE_ID
-------40421
1381
NAME
SHORT_DESC
LONGTEXT_ID
--------------------------------------SUGGESTED_WHLSL_PRICEWHLSL_UNITS
-------------------------------Alexeyer ProStraight bar
928
Lifting Bar
65
40422
1382
41010
41020
41050
41080
41100
50169
1119
929
676
......................................................................................................................................................
B-20
Oracle iDS Forms: Build Internet Applications II
S_PRODUCT Data
.....................................................................................................................................................
ID
NAME
SHORT_DESC
LONGTEXT_ID
---- ----------------------------------------IMAGE_IDSUGGESTED_WHLSL_PRICEWHLSL_UNITS
---------------------------------------50273Chapman HelmetBatting helmet
780
1223
22.89
50417 Griffey GloveOutfielders glove 924
1367
80
50418 Alomar GloveInfielders glove
1368
75
925
926
1037
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-21
Datatype
---------------NUMBER(7)
VARCHAR2(50)
NAME
-------------------------North America
South America
Africa / Middle East
Asia
Europe
......................................................................................................................................................
B-22
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-23
Type
---------------NUMBER(7)
VARCHAR2(25)
VARCHAR2(25)
VARCHAR2(8)
DATE
NUMBER(7)
VARCHAR2(25)
DEPT_TYPE
NUMBER(11,2)
NUMBER(4,2)
emp_type_RefCol
Name
Null?
-------------------- ------------ID
LAST_NAME
FIRST_NAME
USERID
START_DATE
MANAGER_ID
TITLE
DEPT_ID
SALARY
COMMISSION_PCT
Type
---------------NUMBER(7)
VARCHAR2(25)
VARCHAR2(25)
VARCHAR2(8)
DATE
NUMBER(7)
VARCHAR2(25)
REF OF DEPT_TYPE
NUMBER(11,2)
NUMBER(4,2)
dept_type
--------------------------------ID
NAME
REGION_ID
---------------NUMBER
VARCHAR2(25)
NUMBER(7)
......................................................................................................................................................
B-24
Oracle iDS Forms: Build Internet Applications II
Tables
oo_emp_Table_ObjCol
Name
Null?
Type
-------------------- ---------------------------ID
NUMBER(7)
LAST_NAME
VARCHAR2(25)
FIRST_NAME
VARCHAR2(25)
USERID
VARCHAR2(8)
START_DATE
DATE
MANAGER_ID
NUMBER(7)
TITLE
VARCHAR2(25)
DEPT_ID
DEPT_TYPE
SALARY
NUMBER(11,2)
COMMISSION_PCT
NUMBER(4,2)
ID
LAST_NAME
FIRST_NAME
USERID
--------- ----------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------1Velasquez
Carmencvelasqu
03-MAR-90
President
DEPT_TYPE(50, Administration, 1)
2500
2Ngao
08-MAR-90
DEPT_TYPE(41, Operations, 1)
1450
LaDorislngao
1 VP Operations
3Nagayama
17-JUN-91
DEPT_TYPE(31, Sales, 1)
1400
Midorimnagayam
1 VP Sales
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-25
ID
LAST_NAME
FIRST_NAME
USERID
-------------------------------------- -------START_DAT MANAGER_ID
TITLE
--------- ---------------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------4
Quick-To-See Mark
mquickto
07-APR-90
1 VP Finance
DEPT_TYPE(10, Finance, 1)
1450
5
Ropeburn
Audry
aropebur
04-MAR-90
1 VP Administration
DEPT_TYPE(50, Administration, 1)
1550
6
Urguhart
Molly
murguhar
18-JAN-91
2 Warehouse Manager
DEPT_TYPE(41, Operations, 1)
1200
7
Menchu
Roberta
rmenchu
14-MAY-90
2 Warehouse Manager
DEPT_TYPE(42, Operations, 2)
1250
8
Biri
Ben
bbiri
07-APR-90
2 Warehouse Manager
DEPT_TYPE(43, Operations, 3)
1100
9
Catchpole
Antoinette
acatchpo
09-FEB-92
2 Warehouse Manager
DEPT_TYPE(44, Operations, 4)
1300
......................................................................................................................................................
B-26
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- ------------------------------ -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------10
Havel
Marta
mhavel
27-FEB-91
2 Warehouse Manager
DEPT_TYPE(45, Operations, 5)
1307
11 Magee
Colin
cmagee
14-MAY-90
3 Sales Representative
DEPT_TYPE(31, Sales, 1)
1400 10
12
Giljum
Henry
hgiljum
18-JAN-92
3 Sales Representative
DEPT_TYPE(32, Sales, 2)
1490 13
13 Sedeghi
Yasmin
ysedeghi
18-FEB-91
3 Sales Representative
DEPT_TYPE(33, Sales, 3)
1515 10
14
Nguyen
Mai
mnguyen
22-JAN-92
3 Sales Representative
DEPT_TYPE(34, Sales, 4)
1525 15
15 Dumas
Andre
adumas
09-OCT-91
3 Sales Representative
DEPT_TYPE(35, Sales, 5)
145018
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-27
ID
LAST_NAME
FIRST_NAME
USERID
----------------------- --------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------16
Maduro
Elena
emaduro
07-FEB-92
6 Stock Clerk
DEPT_TYPE(41, Operations, 1)
1400
17
Smith
George
08-MAR-90
6 Stock Clerk
DEPT_TYPE(41, Operations, 1)
940
gsmith
18
Nozaki
Akira
09-FEB-91
7 Stock Clerk
DEPT_TYPE(42, Operations, 2)
1200
anozaki
19
Patel
Vikram
06-AUG-91
7 Stock Clerk
DEPT_TYPE(42, Operations, 2)
795
vpatel
20
Newman
Chad
21-JUL-91
8 Stock Clerk
DEPT_TYPE(43, Operations, 3)
750
cnewman
21
Markarian
Alexander
26-MAY-91
8 Stock Clerk
DEPT_TYPE(43, Operations, 3)
850
amarkari
......................................................................................................................................................
B-28
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- ------------------------------ -------START_DAT MANAGER_ID
TITLE
--------- ---------------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------22
Chang
Eddie
echang
30-NOV-90
9 Stock Clerk
DEPT_TYPE(44, Operations, 4)
800
23 Patel
Radha
17-OCT-90
9 Stock Clerk
DEPT_TYPE(34, Sales, 4)
795
rpatel
24
Dancs
Bela
17-MAR-91
10 Stock Clerk
DEPT_TYPE(45, Operations, 5)
860
bdancs
25 Schwartz
Sylvie
09-MAY-91
10 Stock Clerk
DEPT_TYPE(45, Operations, 5)
1100
sschwart
oo_emp_Table_RefCol
Name
Null?
-----------------------------ID
LAST_NAME
FIRST_NAME
USERID
START_DATE
MANAGER_ID
TITLE
Type
---------------NUMBER(7)
VARCHAR2(25)
VARCHAR2(25)
VARCHAR2(8)
DATE
NUMBER(7)
VARCHAR2(25)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-29
DEPT_ID
SALARY
COMMISSION_PCTNUMBER(4,2)
REF OF DEPT_TYPE
NUMBER(11,2)
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------1
Velasquez
Carmen
cvelasqu
03-MAR-90 President
0000220208447F54A9ED64676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
2500
2 Ngao
LaDoris
lngao
08-MAR-90 1 VP Operations
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1450
3 Nagayama
Midori
mnagayam
17-JUN-91 1 VP Sales
0000220208447F54A9ED5A676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1400
4 Quick-To-See
Mark
mquickto
07-APR-90 1 VP Finance
0000220208447F54A9ED59676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1450
5 Ropeburn
Audry
aropebur
04-MAR-90 1 VP Administration
0000220208447F54A9ED64676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1550
......................................................................................................................................................
B-30
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- ------------------ --------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------6
Urguhart
Molly
murguhar
18-JAN-91 2 Warehouse Manager
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1200
9 Catchpole
Antoinette
acatchpo
09-FEB-92 2 Warehouse Manager
0000220208447F54A9ED62676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1300
10 Havel
Marta
mhavel
27-FEB-91 2 Warehouse Manager
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1307
11 Magee
Colin
cmagee
14-MAY-90 3 Sales Representative
0000220208447F54A9ED5A676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1400
10
13 Sedeghi
Yasmin
ysedeghi
18-FEB-91 3 Sales Representative
0000220208447F54A9ED5C676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1515
10
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-31
ID
LAST_NAME
FIRST_NAME
USERID
---------- ------------------ --------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------14 Nguyen
Mai
mnguyen
22-JAN-92 3 Sales Representative
0000220208447F54A9ED5D676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1525
15
15 Dumas
Andre
adumas
09-OCT-91 3 Sales Representative
0000220208447F54A9ED5E676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1450
18
16 Maduro
Elena
emaduro
07-FEB-92 6 Stock Clerk
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1400
17 Smith
George
gsmith
08-MAR-90 6 Stock Clerk
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
940
18 Nozaki
Akira
anozaki
09-FEB-91 7 Stock Clerk
0000220208447F54A9ED60676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1200
......................................................................................................................................................
B-32
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------19 Patel
Vikram
vpatel
06-AUG-91 7 Stock Clerk
0000220208447F54A9ED60676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
795
20 Newman
Chad
cnewman
21-JUL-91 8 Stock Clerk
0000220208447F54A9ED61676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
750
21 Markarian
Alexander
amarkari
26-MAY-91
8 Stock Clerk
0000220208447F54A9ED61676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
850
22 Chang
Eddie
echang
30-NOV-90
9 Stock Clerk
0000220208447F54A9ED62676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
800
23 Patel
Radha
rpatel
17-OCT-90
9 Stock Clerk
0000220208447F54A9ED5D676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
795
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-33
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------24 Dancs
Bela
bdancs
17-MAR-91 10 Stock Clerk
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
860
25 Schwartz
Sylvie
sschwart
09-MAY-91 10 Stock Clerk
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1100
oo_dept_table
Name
-------------------ID
NAME
REGION_ID
Null?
-------------
Type
---------------NUMBER
VARCHAR2(25)
NUMBER(7)
ID
-------------------10
31
32
33
34
35
41
42
43
NAME
------------Finance
Sales
Sales
Sales
Sales
Sales
Operations
Operations
Operations
REGION_ID
---------------1
1
2
3
4
5
1
2
3
......................................................................................................................................................
B-34
Oracle iDS Forms: Build Internet Applications II
44
45
50
Operations
Operations
Administration
4
5
1
Null?
-------------
Type
---------------NUMBER(7)
VARCHAR2(25)
VARCHAR2(25)
VARCHAR2(8)
DATE
NUMBER(7)
VARCHAR2(25)
DEPT_TYPE
NUMBER(11,2)
NUMBER(4,2)
rel_emp_Table_Objcol
Name
-------------------ID
LAST_NAME
FIRST_NAME
USERID
START_DATE
MANAGER_ID
TITLE
DEPT_ID
SALARY
COMMISSION_PCT
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------1
Velasquez
Carmen
cvelasqu
03-MAR-90 President
DEPT_TYPE(50, Administration, 1)
2500
2 Ngao
LaDoris
08-MAR-90 1 VP Operations
DEPT_TYPE(41, Operations, 1)
1450
lngao
3 Nagayama
Midori
17-JUN-91
1 VP Sales
DEPT_TYPE(31, Sales, 1)
1400
mnagayam
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-35
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------4
Quick-To-See
Mark
mquickto
07-APR-90 1 VP Finance
DEPT_TYPE(10, Finance, 1)
1450
5 Ropeburn
Audry
aropebur
04-MAR-90
1 VP Administration
DEPT_TYPE(50, Administration, 1)
1550
6 Urguhart
Molly
murguhar
18-JAN-91
2 Warehouse Manager
DEPT_TYPE(41, Operations, 1)
1200
7 Menchu
Roberta
rmenchu
14-MAY-90
2 Warehouse Manager
DEPT_TYPE(42, Operations, 2)
1250
8 Biri
Ben
bbiri
07-APR-90
2 Warehouse Manager
DEPT_TYPE(43, Operations, 3)
1100
9 Catchpole
Antoinette
acatchpo
09-FEB-92
2 Warehouse Manager
DEPT_TYPE(44, Operations, 4)
1300
......................................................................................................................................................
B-36
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------10
Havel
Marta
mhavel
27-FEB-91
2 Warehouse Manager
DEPT_TYPE(45, Operations, 5)
1307
11 Magee
Colin
cmagee
14-MAY-90
3 Sales Representative
DEPT_TYPE(31, Sales, 1)
1400
10
12 Giljum
Henry
hgiljum
18-JAN-92
3 Sales Representative
DEPT_TYPE(32, Sales, 2)
1490
13
13 Sedeghi
Yasmin
ysedeghi
18-FEB-91
3 Sales Representative
DEPT_TYPE(33, Sales, 3)
1515
10
14 Nguyen
Mai
mnguyen
22-JAN-92
3 Sales Representative
DEPT_TYPE(34, Sales, 4)
1525
15
15 Dumas
Andre
adumas
09-OCT-91
3 Sales Representative
DEPT_TYPE(35, Sales, 5)
1450
18
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-37
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------16 Maduro
Elena
emaduro
07-FEB-92
6 Stock Clerk
DEPT_TYPE(41, Operations, 1)
1400
17 Smith
George
08-MAR-90
6 Stock Clerk
DEPT_TYPE(41, Operations, 1)
940
gsmith
18 Nozaki
Akira
09-FEB-91
7 Stock Clerk
DEPT_TYPE(42, Operations, 2)
1200
anozaki
19 Patel
Vikram
06-AUG-91
7 Stock Clerk
DEPT_TYPE(42, Operations, 2)
795
vpatel
20 Newman
Chad
21-JUL-91
8 Stock Clerk
DEPT_TYPE(43, Operations, 3)
750
cnewman
21 Markarian
Alexander
26-MAY-91
8 Stock Clerk
DEPT_TYPE(43, Operations, 3)
850
amarkari
......................................................................................................................................................
B-38
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------22 Chang
Eddie
echang
30-NOV-90
9 Stock Clerk
DEPT_TYPE(44, Operations, 4)
800
23 Patel
Radha
17-OCT-90
9 Stock Clerk
DEPT_TYPE(34, Sales, 4)
795
rpatel
24 Dancs
Bela
17-MAR-91
10 Stock Clerk
DEPT_TYPE(45, Operations, 5)
860
bdancs
25 Schwartz
Sylvie
09-MAY-91
10 Stock Clerk
DEPT_TYPE(45, Operations, 5)
1100
sschwart
rel_emp_Table_RefCol
Name
-------------------ID
LAST_NAME
FIRST_NAME
USERID
START_DATE
MANAGER_ID
TITLE
Null?
-------------
Type
---------------NUMBER(7)
VARCHAR2(25)
VARCHAR2(25)
VARCHAR2(8)
DATE
NUMBER(7)
VARCHAR2(25)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-39
DEPT_ID
SALARY
COMMISSION_PCT
REF OF DEPT_TYPE
NUMBER(11,2)
NUMBER(4,2)
......................................................................................................................................................
B-40
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------1
Velasquez
Carmen
cvelasqu
03-MAR-90
President
0000220208447F54A9ED64676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
2500
2 Ngao
LaDoris
lngao
08-MAR-90
1 VP Operations
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1450
3 Nagayama
Midori
mnagayam
17-JUN-91
1 VP Sales
0000220208447F54A9ED5A676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1400
4 Quick-To-See
Mark
mquickto
07-APR-90
1 VP Finance
0000220208447F54A9ED59676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1450
5 Ropeburn
Audry
aropebur
04-MAR-90
1 VP Administration
0000220208447F54A9ED64676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1550
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-41
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------6 Urguhart
Molly
murguhar
18-JAN-91
2 Warehouse Manager
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1200
9 Catchpole
Antoinette
acatchpo
09-FEB-92
2 Warehouse Manager
0000220208447F54A9ED62676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1300
10 Havel
Marta
mhavel
27-FEB-91
2 Warehouse Manager
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1307
11 Magee
Colin
cmagee
14-MAY-90
3 Sales Representative
0000220208447F54A9ED5A676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1400
10
13 Sedeghi
Yasmin
ysedeghi
18-FEB-91
3 Sales Representative
0000220208447F54A9ED5C676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1515
10
......................................................................................................................................................
B-42
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------14 Nguyen
Mai
mnguyen
22-JAN-92
3 Sales Representative
0000220208447F54A9ED5D676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1525
15
15 Dumas
Andre
adumas
09-OCT-91
3 Sales Representative
0000220208447F54A9ED5E676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1450
18
16 Maduro
Elena
emaduro
07-FEB-92
6 Stock Clerk
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1400
17 Smith
George
gsmith
08-MAR-90
6 Stock Clerk
0000220208447F54A9ED5F676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
940
18 Nozaki
Akira
anozaki
09-FEB-91
7 Stock Clerk
0000220208447F54A9ED60676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1200
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-43
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------19 Patel
Vikram
vpatel
06-AUG-91
7 Stock Clerk
0000220208447F54A9ED60676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
795
20 Newman
Chad
cnewman
21-JUL-91
8 Stock Clerk
0000220208447F54A9ED61676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
750
21 Markarian
Alexander
amarkari
26-MAY-91
8 Stock Clerk
0000220208447F54A9ED61676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
850
22 Chang
Eddie
echang
30-NOV-90
9 Stock Clerk
0000220208447F54A9ED62676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
800
23 Patel
Radha
rpatel
17-OCT-90
9 Stock Clerk
0000220208447F54A9ED5D676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
795
......................................................................................................................................................
B-44
Oracle iDS Forms: Build Internet Applications II
ID
LAST_NAME
FIRST_NAME
USERID
---------- --------------------------------- -------START_DAT MANAGER_ID TITLE
--------- ---------- ------------------------DEPT_ID(ID, NAME, REGION_ID)
-----------------------------------------------------------SALARY COMMISSION_PCT
---------- -------------24 Dancs
Bela
bdancs
17-MAR-91
10 Stock Clerk
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
860
25 Schwartz
Sylvie
sschwart
09-MAY-91
10 Stock Clerk
0000220208447F54A9ED63676AE03408002072C15B447F54A9ED55676AE03408
002072C15B
1100
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
B-45
......................................................................................................................................................
B-46
Oracle iDS Forms: Build Internet Applications II
................................
Introduction
Overview
You have already seen how to use mouse action triggers and built-ins. This appendix
explains how to develop drag-and-drop functionality with Client Server forms
applications.
Objectives
After completing this appendix, you should be able to implement drag-and-drop
functionality with Client Server forms.
Item-A highlighted
Items repositioned
Instructor Note
A library named drag.pll is shipped with the product. Use the following steps as a
demonstration:
1 Create a new form module and a new text item manually.
2 Attach the PL/SQL library drag.pll to your form.
3 For this item, create a When-Mouse-Down trigger, a
When-Mouse-Move trigger, and a When-Mouse-Up trigger.
In the When-Mouse-Down trigger, include the following statement:
MOUSE.CLICK;
......................................................................................................................................................
C-2
Oracle iDS Forms: Build Internet Applications II
Introduction
.....................................................................................................................................................
You can also include code here to change the cursor to indicate that a drag
operation is occurring.
In the When-Mouse-Move trigger, include the following statement:
IF :SYSTEM.MOUSE_BUTTON_PRESSED =1 THEN
MOUSE.MOVE;
END IF;
In the When-Mouse-Up trigger, add your application-specific code, which should
check where the object has been dropped, and take appropriate action.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
C-3
......................................................................................................................................................
C-4
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
C-5
Summary
In this Appendix, you should have learned how to implement drag-and-drop
functionality in your Client Server form applications by using appropriate mouse
triggers and system variables.
Mouse Triggers
When_Mouse_Move
When_Mouse_Up
When_Mouse_Down
Mouse System Varaiables
:SYSTEM.MOUSE_ITEM
SYSTEM.MOUSE_X_POS
:SYSTEM.MOUSE_Y_POS
......................................................................................................................................................
C-6
Oracle iDS Forms: Build Internet Applications II
................................
Introduction to
Oracle8i Object Features
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
Objectives
......................................................................................................................................................
D-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
In this appendix you will review certain object features of Oracle8i. This appendix
also explains how these objects are displayed in the Object Navigator.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-3
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
NCHAR
NVARCHAR2
FLOAT
NLS types
......................................................................................................................................................
D-4
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-5
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
Object Types
Attributes
ORDER
po_no
custinfo
line_items
amount
Methods
Copyright Oracle Corporation, 2001. All rights reserved.
......................................................................................................................................................
D-6
Oracle iDS Forms: Build Internet Applications II
Object Types
......................................................................................................................................................
Object Types
An object type is a user-defined composite data type. You build object types from
predefined data types or from previously defined object types. When you create an
object type you specify the component types from which it is built. You also specify
the functions and procedures that can act on the object type. Thus, an object type is in
some ways similar to a record type, and in some ways similar to a package.
An object type must have one or more attributes and can contain methods.
Attributes An object type is similar to a record type in that it is composed of one or
more subparts that are of predefined data types. Record types call these subparts fields,
but object types call these subparts attributes.
Attributes define the object structure.
CREATE TYPE address_type AS OBJECT
(address VARCHAR2(30),
city VARCHAR2(15),
stateCHAR(2),
zip CHAR(5));
CREATE TYPE phone_type AS OBJECT
(country NUMBER(2),
area NUMBER(4),
phoneNUMBER(9));
Just as the fields of a record type can be of other record types, the attributes of an
object type can be of other object types. Such an object type is called nested.
CREATE TYPE address_and_phone_type AS OBJECT
(address address_type,
phonephone_type);
Object types are like record types in another sense: Both of them must be declared as
types before the actual object or record can be declared.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-7
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
Object Types
Ship
ORDER
Cancel
Check
status
Hold
......................................................................................................................................................
D-8
Oracle iDS Forms: Build Internet Applications II
Object Types
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-9
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
Object Tables
Instructor Note
At this point, review the fact that object types are not themselves objects. They are
only blueprints for objects.
The term object can be confusing because Oracle uses the term to refer to constructs
within the database; for example, tables, views, procedures, and so on. These objects
are not related to object types. Make certain your students are aware of the distinction
between these terms.
......................................................................................................................................................
D-10
Oracle iDS Forms: Build Internet Applications II
SQL and PL/SQL treat object tables very similarly to relational tables, with the
attribute of the object corresponding to the columns of the table, but there are
significant differences. The most important difference is that rows in an object table
are assigned object IDs (OIDs) and can be referenced by using a REF type.
Note: REF types are reviewed later.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-11
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
Object Columns
......................................................................................................................................................
D-12
Oracle iDS Forms: Build Internet Applications II
Object Columns
......................................................................................................................................................
Object Columns
Another construct that you can base on an object type is an object column in a
relational table. Here is an example of a relational table creation statement with an
object column:
CREATE TABLE o_customer (
custid
NUMBER (6) NOT NULL,
name
VARCHAR2 (45),
repid
NUMBER (4) NOT NULL,
creditlimit NUMBER (9,2),
address
address_type,
phone
phone_type);
In the object table, the rows of a table are objects. In a relational table with an object
column, the column is an object. The table will usually have standard columns, as well
as one or more object column.
Object columns are not assigned object IDs (OIDs), and therefore cannot be
referenced by using object REF values.
Note: Object REFs are reviewed later in this section.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-13
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
Object Views
Object-oriented
application
Object
view
Relational
table
......................................................................................................................................................
D-14
Oracle iDS Forms: Build Internet Applications II
Object Views
......................................................................................................................................................
Object Views
Often the most difficult part of adopting a new technology is the conversion process
itself. For example, a large enterprise might have several applications accessing the
same data stored in relational tables. If such an enterprise decided to start using objectrelational technology, it would not convert all of the applications at once, but would
convert the applications one at a time.
This presents a problem. The applications that have been converted need the data
stored as objects, while the applications that have not been converted need the data
stored in relational tables.
This dilemma is addressed by object views. Like all views, an object view transforms
the way a table appears to a user, without changing the actual structure of the table.
Object views make relational tables look like object tables. This enables developers to
postpone converting the data from relational structures to object-relational structures
until after all of the applications have been converted. During the conversion process,
the object-relational applications can operate against the object view, while the
relational applications can continue to operate against the relational tables.
Objects accessed through object views are assigned Object IDs (OIDs) and can be
referenced by using Object REFs.
Note: Object REFs are reviewed later in this section.
Here is an example of an object view creation statement:
CREATE VIEW emp_view OF emp_type
WITH OBJECT OID (eno)
AS
SELECT
e.empno, e.ename, e.sal, e.job
FROM
emp e;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-15
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
INSTEAD-OF Triggers
DECLARE
BEGIN
EXCEPTION
END;
Nonupdatable view
INSTEAD-OF trigger
......................................................................................................................................................
D-16
Oracle iDS Forms: Build Internet Applications II
INSTEAD-OF Triggers
......................................................................................................................................................
INSTEAD-OF Triggers
INSTEAD-OF triggers provide a transparent way of modifying views that cannot be
modified directly through SQL DML statements (INSERT, UPDATE, and DELETE).
These triggers are called INSTEAD-OF triggers because, unlike other types of
triggers, Oracle fires the trigger instead of executing the triggering statement. The
trigger performs update, insert, or delete operations directly on the underlying tables.
Users write normal INSERT, DELETE, and UPDATE statements against the view, and
the INSTEAD-OF trigger works invisibly in the background to make the right actions
take place.
INSTEAD-OF triggers are activated for each row.
Note: Although you can use INSTEAD-OF triggers with any view, they are typically
required with object views.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-17
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
References to Objects
OID
......................................................................................................................................................
D-18
Oracle iDS Forms: Build Internet Applications II
Referencing Objects
......................................................................................................................................................
Referencing Objects
Introduction
In relational databases, primary-key values are used to uniquely identify records. In
object-relational databases, OIDs provide an alternate method.
When a row in an object table or object view is created, it is assigned automatically a
unique identifier called an object ID (OID).
Object REFs
With relational tables, you can associate two records by storing the primary key of one
record in one of the columns (the foreign-key column) of another.
In a similar way, you can associate a row in a relational table to an object by storing
the OID of an object in a column of a relational table.
Or you can associate two objects by storing the OID of one object in an attribute of
another.
The stored copy of the OID then becomes a pointer, or reference (REF), to the original
object.
The attribute or column that holds the OID is of data type REF.
Note: Object columns are not assigned OIDs and cannot be pointed to by a REF.
Here is an example of a table declaration that includes a column with a REF data type:
CREATE TABLE o_emp
( empno NUMBER(4) NOT NULL,
ename
VARCHAR2(10),
job
VARCHAR2(10),
mgr
NUMBER(4),
hiredate DATE,
sal
NUMBER(7,2),
comm
NUMBER(7,2),
dept
REF dept_type SCOPE IS o_dept) ;
Note: The REF is scoped here to restrict the reference to a single table, o_dept. The
object itself is not stored in the table; only the OID value for the object is stored there.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-19
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
......................................................................................................................................................
D-20
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-21
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
......................................................................................................................................................
D-22
Oracle iDS Forms: Build Internet Applications II
Object Tables
Object tables are displayed like relational tables, with the attributes of the object
displayed like columns in a relational table. Additionally, the object table type name is
displayed in parentheses after the name of the object table.
Object Columns
Object columns are displayed with the object type in parentheses after the column
name, and with the attributes of the type indented underneath the column name.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-23
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
......................................................................................................................................................
D-24
Oracle iDS Forms: Build Internet Applications II
Object Views
Object views are displayed like any other view, except that the object type they are
based on is written in parentheses after the view name.
INSTEAD-OF Triggers
You can create INSTEAD-OF database triggers through the trigger creation dialog
box, just as you would any other database trigger.
INSTEAD-OF INSERT, UPDATE, and DELETE triggers allow you to directly insert,
update, and delete against object views. They can also be used with any other type of
view that does not allow direct DML.
When a view has an INSTEAD-OF trigger, the code in the trigger is executed in place
of the triggering DML code.
Reference For more information about INSTEAD-OF triggers, see:
Oracle8i Server SQL Reference Manual
Oracle8i Concepts Manual
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-25
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
......................................................................................................................................................
D-26
Oracle iDS Forms: Build Internet Applications II
Object REFs
Object types that contain attributes of type REF, and relational tables that have
columns of type REF, display the keyword REF before the name of the object type that
is being referenced.
The attributes of the referenced object type are displayed indented underneath the
column or attribute.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-27
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
Summary
Summary
......................................................................................................................................................
D-28
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
New Oracle8i Data Types
Oracle8i introduced three new scalar data types and new composite data types such as
object types.
Objects
Three kinds of objects are object tables, object columns, and object views.
INSTEAD-OF triggers allow DML on object views.
Object REFs store the Object Identifier of certain types of objects.
Oracle8i Objects In the Object Navigator
The Object Navigator can display certain types of objects.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
D-29
Appendix
D: Introduction to Oracle8i Object Features
......................................................................................................................................................
......................................................................................................................................................
D-30
Oracle iDS Forms: Build Internet Applications II
................................
Menu Run-Time
Parameters
Appendix
E: Menu Run-Time Parameters
......................................................................................................................................................
Objectives
......................................................................................................................................................
E-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
In this lesson, you will learn how to modify menus dynamically, as well as
how to control application security through menu access.
Objectives
After completing this lesson, you should be able to customize menu modules
by using substitution parameters.
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
E-3
Appendix
E: Menu Run-Time Parameters
......................................................................................................................................................
UN
Current username
PW
Current password
AD
Directory name
SO
TT
Terminal type
LN
Language used
Design time
Run time
Instructor Note
Demonstration: Open the Customized Menu demonstration (menu.mmb)
and select the print option. Show the code and the use of the UN and PW
substitution parameters.
......................................................................................................................................................
E-4
Oracle iDS Forms: Build Internet Applications II
Substitution Parameters
......................................................................................................................................................
Substitution Parameters
What Is a Substitution Parameter?
A substitution parameter is a two-character variable of type CHAR that is
referenced in a menu item command or in a PL/SQL program unit, and
substituted with a value at run time. A menu module provides some
predefined parameters, which automatically exist in every menu module.
You can also create in Form Builder (valid for a given menu module) your
own user-named parameters.
Predefined Substitution Parameters
You can use six predefined (built-in) substitution parameters. Form Builder
automatically processes them at run time.
Parameter
UN
PW
AD
SO
TT
LN
Description
Current username
Current password
Directory name containing the current menu module run-time file
Current menu name (selected option)
Terminal type used at connection
Language used (NLS_LANG parameter)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
E-5
Appendix
E: Menu Run-Time Parameters
......................................................................................................................................................
Parameter Properties
- Name
- Label
- Case Restriction
- Conceal Data
- Associated Menus
- Maximum Length
- Menu Parameter
Initial Value
- Required
- Hint
......................................................................................................................................................
E-6
Oracle iDS Forms: Build Internet Applications II
Description
The two-letter parameter name
The text prompt for the parameter value that is displayed in
the Enter Parameter Values dialog box
Case Restriction
The property that converts the case of the users input to
either uppercase, lowercase, or none
Conceal Data
The property that determines whether the users input is echoed on the screen
Associated Menus
All menu names where the parameter can be used (full-screen
menus only)
Maximum Length
Value maximum length
Menu Parameter Initial Value The default value for the parameter; displayed in the parameter value field when the Enter Parameter Values dialog box is
displayed
Required
Mandatory or not; set Yes if the value is required or No to
allow the parameter value to be set to Null
Hint
The text string displayed on the message line of the console
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
E-7
Appendix
E: Menu Run-Time Parameters
......................................................................................................................................................
QUERY_PARAMETER
APPLICATION_PARAMETER
In a PL/SQL routine:
Prefix the parameter name with &
when entered through a dialog box
Prefix the parameter name with :
when entered in the PL/SQL editor
Example: :param_name
Instructor Note
You can prompt for several menu parameters by using the following syntax:
Query_Parameter(&p1 &p2 &p3);
......................................................................................................................................................
E-8
Oracle iDS Forms: Build Internet Applications II
Description
Displays the Query Parameter dialog box showing the
current values of the specified substitution parameters
(End users can set the value of any parameter you include
in the list.)
APPLICATION_PARAMETER Displays all the parameters associated with the current
menu, and their current values, in the Enter Parameter
Values dialog box
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
E-9
Appendix
E: Menu Run-Time Parameters
......................................................................................................................................................
Validating Substitution
Parameter Values
MENU_SUCCESS function:
......................................................................................................................................................
E-10
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
E-11
Appendix
E: Menu Run-Time Parameters
......................................................................................................................................................
Summary
......................................................................................................................................................
E-12
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
Substitution Parameters
Using &UN, &PW, &AD, &SO, &TT, and &LN
Creating user-named substitution parameters
Programmatically controlling substitution parameters with
QUERY_PARAMETER and APPLICATION_PARAMETER
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
E-13
Appendix
E: Menu Run-Time Parameters
......................................................................................................................................................
......................................................................................................................................................
E-14
Oracle iDS Forms: Build Internet Applications II
................................
Handling Server-Side
Errors
Appendix
F: Handling Server-Side Errors
......................................................................................................................................................
Objectives
......................................................................................................................................................
F-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
This lesson covers the use of Oracle server features in Form Builder
applications. You will learn about handling Oracle server errors, including
declarative-constraint violations.
Objectives
At the end of this lesson, you should be able to:
Handle errors raised by the Oracle server
Obtain the cause of declarative-constraint violations
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
F-3
Appendix
F: Handling Server-Side Errors
......................................................................................................................................................
Instructor Note
Demonstration: Use the Handling of Server Errors (errh.fmb) file to
show the code for the STRIP_CONSTRAINT_NAME function. This
function forms part of the HANDLE_SERVER_ERROR procedure. Do not
talk through all of the code, because the HANDLE_SERVER_ERROR
procedure is covered later in this lesson.
Demonstration for next page pair: Use the Message (msg.fmb) file to
show how you can use your own message table to hold constraint messages.
Run the form and point out that two messages appear for foreign key
constraints.
Use the Handling of Server Errors (errh.fmb)file to show the code for
the STRIP_APPLICATION_ERROR function. This function is the form
part of the HANDLE_SERVER_ERROR procedure.
......................................................................................................................................................
F-4
Oracle iDS Forms: Build Internet Applications II
Check
Error Message
ORA-00001: unique constraint (schema.constraint) violated
Unique Key
ORA-02291: integrity constraint (schema.constraint) violatedparent
key not found
ORA-02292: integrity constraint (schema.constraint) violatedchild
record found
ORA-02290: check constraint (schema.constraint) violated
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
F-5
Appendix
F: Handling Server-Side Errors
......................................................................................................................................................
Technical Note
A foreign-key constraint violation can have two causes: parent key not
found or child record found. Therefore, two error messages are
associated with one foreign-key constraint name.
......................................................................................................................................................
F-6
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
F-7
Appendix
F: Handling Server-Side Errors
......................................................................................................................................................
Instructor Note
Demonstration: Use the Handling of Server Errors (errh.fmb) file to
show the code for the HANDLE_SERVER_ERROR procedure. This
procedure contains both functions already discussed.
......................................................................................................................................................
F-8
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
F-9
Appendix
F: Handling Server-Side Errors
......................................................................................................................................................
Technical Note
Error code 40508 is insert failed. Error code 40509 is update failed. Error
code 40510 is delete failed.
Instructor Note
Demonstration: Use the Handling of Server Errors (errh.fmb)
demonstration file to show the code for the HANDLE_FRM_ERROR
procedure. This procedure is called from the On-Error trigger.
Explanation for the next page pair: Remind students that all DDL operations
issue an implicit commit and end the current transaction. Form Builder is not
allowed to process any pending changes.
Stress that FORMS_DDL itself does not issue an implicit commit, but this
can be done by any DDL statement.
......................................................................................................................................................
F-10
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
F-11
Appendix
F: Handling Server-Side Errors
......................................................................................................................................................
Summary
......................................................................................................................................................
F-12
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
Handling Errors Raised by the Oracle Server
Causes: Declarative constraints, database triggers, stored program units
Trap implicit-DML errors by using DBMS_ERROR_CODE and
DBMS_ERROR_TEXT in an On-Error trigger
Trap explicit DML errors and stored program unit errors by using
SQLCODE and SQLERRM in a WHEN OTHERS exception handler
Replacing Oracle Server Error Messages with Customized Messages
Declarative constraint: Strip the constraint name from the Oracle Server
error message and retrieve the message from the messages table
Database triggers and stored program units: Strip the application error
message from the Oracle Server error message
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
F-13
Appendix
F: Handling Server-Side Errors
......................................................................................................................................................
......................................................................................................................................................
F-14
Oracle iDS Forms: Build Internet Applications II
................................
EMP_PKG Package
Appendix
G: EMP_PKG Package
......................................................................................................................................................
Package Specification
/*******************************************************/
/* This is an example of a stored procedure that:
*/
/* query, insert, update, delete, and lock rows of the */
/* EMP table.
*/
/* A package is used to logically group the related
*/
/* data types and procedures
*/
/*******************************************************/
PACKAGE emp_pkg AS
TYPE emprec IS RECORD(
--- Defines eack row of the table EMP
empno
emp.empno%TYPE,
ename
emp.ename%TYPE,
job
emp.job%TYPE,
mgr
emp.mgr%TYPE,
hiredate emp.hiredate%TYPE,
sal
emp.sal%TYPE,
comm
emp.comm%TYPE,
deptno emp.deptno%TYPE);
--- Defines each row of the table EMP.EMPNO
TYPE empnorec IS RECORD ( empno emp.empno%TYPE);
--- Define the Ref Cursor
TYPE empcur IS REF CURSOR RETURN emprec;
--- Defines the Table of Records EMP
TYPE emptab IS TABLE OF emprec INDEX BY BINARY_INTEGER;
--- Defines the Table of Records EMP.EMPNO
TYPE empnotab IS TABLE OF empnorec INDEX BY BINARY_INTEGER;
......................................................................................................................................................
G-2
Oracle iDS Forms: Build Internet Applications II
Package Specification
......................................................................................................................................................
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
G-3
Appendix
G: EMP_PKG Package
......................................................................................................................................................
Package Body
PACKAGE BODY emp_pkg AS
/**************************/
/* QUERY USING REF CURSOR */
/**************************/
PROCEDURE empquery_refcur( block_data IN OUT empcur,
p_deptno IN NUMBER)
IS
BEGIN
OPEN block_data FOR
SELECT empno, ename, job, mgr, hiredate, sal, comm, deptno
FROM emp
WHERE deptno = NVL(p_deptno, deptno)
ORDER BY empno;
END;
. . .
......................................................................................................................................................
G-4
Oracle iDS Forms: Build Internet Applications II
Package Body
......................................................................................................................................................
/********************************/
/* QUERY USING TABLE OF RECORDS */
/********************************/
PROCEDURE empquery( block_data IN OUT emptab,
p_deptno IN NUMBER)
IS
i NUMBER;
CURSOR empselect IS
SELECT empno, ename, job, mgr, hiredate,
sal, comm, deptno
FROM emp
WHERE deptno = NVL(p_deptno, deptno)
ORDER BY empno;
BEGIN
OPEN empselect;
i := 1;
LOOP
FETCH empselect INTO block_data(i).empno,
block_data(i).ename,
block_data(i).job,
block_data(i).mgr,
block_data(i).hiredate,
block_data(i).sal,
block_data(i).comm,
block_data(i).deptno;
EXIT WHEN empselect%NOTFOUND;
i := i + 1;
END LOOP;
END;
. . .
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
G-5
Appendix
G: EMP_PKG Package
......................................................................................................................................................
/**********/
/* INSERT */
/**********/
PROCEDURE empinsert(block_data IN emptab)
IS
i NUMBER;
cnt NUMBER;
BEGIN
cnt := block_data.count;
FOR i IN 1..cnt
LOOP
INSERT INTO emp( empno, ename, job, mgr,
hiredate, sal, comm, deptno)
VALUES( block_data(i).empno, block_data(i).ename,
block_data(i).job, block_data(i).mgr,
block_data(i).hiredate, block_data(i).sal,
block_data(i).comm, block_data(i).deptno);
END LOOP;
END;
. . .
......................................................................................................................................................
G-6
Oracle iDS Forms: Build Internet Applications II
Package Body
......................................................................................................................................................
/**********/
/* UPDATE */
/**********/
PROCEDURE empupdate(block_data IN emptab)
IS
i NUMBER;
cnt NUMBER;
BEGIN
cnt := block_data.count;
FOR i IN 1..cnt
LOOP
UPDATE emp
SET ename
= block_data(i).ename,
job
= block_data(i).job,
mgr
= block_data(i).mgr,
hiredate = block_data(i).hiredate,
sal
= block_data(i).sal,
comm
= block_data(i).comm,
deptno = block_data(i).deptno
WHERE empno = block_data(i).empno;
END LOOP;
END;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
G-7
Appendix
G: EMP_PKG Package
......................................................................................................................................................
/**********/
/* DELETE */
/**********/
PROCEDURE empdelete(block_data IN empnotab)
IS
i NUMBER;
cnt NUMBER;
BEGIN
cnt := block_data.count;
FOR i IN 1..cnt
LOOP
DELETE FROM emp WHERE empno = block_data(i).empno;
END LOOP;
END;
/********/
/* LOCK */
/********/
PROCEDURE emplock(block_data IN empnotab)
IS
i NUMBER;
cnt NUMBER;
block_rec emprec;
BEGIN
cnt := block_data.count;
FOR i IN 1..cnt
LOOP
SELECT empno, ename, job, mgr,
hiredate, sal, comm, deptno
INTO block_rec
FROM emp
WHERE empno = block_data(i).empno
FOR UPDATE OF ename NOWAIT;
END LOOP;
END;
END;
......................................................................................................................................................
G-8
Oracle iDS Forms: Build Internet Applications II
Package Body
......................................................................................................................................................
To have an idea of how Form Builder works when a data block is based on a
stored procedure returning a REF CURSOR, you can run the following
script under Sql*Plus:
DECLARE
v_rec emp_pkg.emprec;
v_ref emp_pkg.empcur;
BEGIN
emp_pkg.emp_query_refcur(v_ref, 10);
LOOP
FETCH v_ref INTO v_rec;
EXIT WHEN v_ref%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(v_rec.empno);
DBMS_OUTPUT.PUT_LINE(v_rec.ename);
DBMS_OUTPUT.PUT_LINE(v_rec.job);
DBMS_OUTPUT.PUT_LINE(v_rec.mgr);
DBMS_OUTPUT.PUT_LINE(v_rec.hiredate);
DBMS_OUTPUT.PUT_LINE(v_rec.sal);
DBMS_OUTPUT.PUT_LINE(v_rec.comm);
DBMS_OUTPUT.PUT_LINE(v_rec.deptno);
END LOOP;
CLOSE v_ref;
END;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
G-9
Appendix
G: EMP_PKG Package
......................................................................................................................................................
......................................................................................................................................................
G-10
Oracle iDS Forms: Build Internet Applications II
................................
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
Objectives
......................................................................................................................................................
H-2
Oracle iDS Forms: Build Internet Applications II
Introduction
......................................................................................................................................................
Introduction
Overview
In this appendix, you will learn how to include and use ActiveX controls in
your Oracle Forms Developer application.
Objectives
After completing this lesson, you should be able to do the following:
Explain the differences between VBX, OCX, and ActiveX controls
Access ActiveX properties at design time and run time
Import ActiveX control methods and events packages
Customize event handling
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-3
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
VBX
Custom Interface Object
Special dynamic link library
OCX
Independent program module
Run in any Windows application that is
OLE-enabled
ActiveX
Third version of OCX
Provide integrated controls in Browsers
......................................................................................................................................................
H-4
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-5
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
OCX
Controls
ActiveX
Controls
Operating
platform
16-bit applications
only
Candidate
applications
Coding
interface
Proprietary
Standard OLE2
Webenabled
No
No
Yes
Instructor Note
ActiveX controls can be deployed on the Web, but not with Web-deployed
Forms. Oracle Forms Developer applications can be enhanced with
JavaBeans
......................................................................................................................................................
H-6
Oracle iDS Forms: Build Internet Applications II
Operating
platform
Candidate
applications
Coding
interface
Web-enabled
VBX Controls
OCX Controls
ActiveX Controls
16-bit
applications only
Only those
written with a
specific interface
to VBXs
Proprietary
Standard OLE2
Standard OLE2
No
No
Yes
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-7
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
ActiveX controls:
Dynamic library in .ocx files
Support events, properties, and methods
......................................................................................................................................................
H-8
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-9
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
Creating an ActiveX
Control Item
......................................................................................................................................................
H-10
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-11
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
OLE
OLE Class
Class
Control
Control Properties
Properties
About
About Control
Control
Control
Control Help
Help
Copyright Oracle Corporation, 2001. All rights reserved.
Technical Note
If you have created a container using the OCX button from the Layout
Editor, then Create Control is the only available option on the Insert Object
dialog box.
......................................................................................................................................................
H-12
Oracle iDS Forms: Build Internet Applications II
Description
OLE Class
Control Properties
About Control
Displays information about the control (Please note that this feature
might not be exposed by the control that you are using.)
Control Help
Displays online Help for the control (Please note that this feature
might not be exposed by the control that you are using.)
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-13
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
Select Program
OLE Importer
6
- Program Units
+
+
+
3
4
PackageName1 (Spec)
PackageName1 (Body)
...
5
Copyright Oracle Corporation, 2001. All rights reserved.
......................................................................................................................................................
H-14
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-15
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
:Item(
:Item(item_name).OCX.server_name.property
item_name).OCX.server_name.property
Example
:item(
:item(ActXitem).OCX.Spindial.spindialctrl
ActXitem).OCX.Spindial.spindialctrl
.1.Needleposition:=:item(ActXitem).OCX.
.1.Needleposition:=:item(ActXitem).OCX.
Spindial.spindialctrl.1.Needleposition
Spindial.spindialctrl.1.Needleposition
++ 1;
1;
Copyright Oracle Corporation, 2001. All rights reserved.
......................................................................................................................................................
H-16
Oracle iDS Forms: Build Internet Applications II
Server_name represents the name of the server. This name is the one you
have selected for the OLE Class property. Property is the name of a specific
property of the ActiveX control. To obtain more information, see the Control
Help property, if available, or the documentation.
/* Setting an ActiveX control property using bind variable
syntax */
:item(ActXitem).OCX.Spindial.spindialctrl.1.Needleposition
:=
:item(ActXitem).OCX.Spindial.spindialctrl.1.Needleposition +1;
/* ActXitem is the name of the item,
Spindial.spindialctrl.1 is the name of the ActiveX
control server, and Needleposition is the name of the
property. */
/* The following code also works if your system.cursor_item
is an ActiveX control: */
:form.cursor_item.OCX.spindial.spindialctrl.1.Needlposition :=
:form.cursor_item.OCX.spindial.spindialctrl.1.Needlposition + 1;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-17
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
tblname varchar2;
tblname := table_pkg.TableName(
:item(Oblk.Oitm).interface);
......................................................................................................................................................
H-18
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-19
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
MMVX_DMMVX.PLAY(:item
MMVX_DMMVX.PLAY(:item
((video_ocx.video
video_ocx.video).INTERFACE);
).INTERFACE);
Copyright Oracle Corporation, 2001. All rights reserved.
......................................................................................................................................................
H-20
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-21
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
FORMS4W.DISPATCH_EVENT
(RESTRICTED_UNALLOWED);
Initialization events do not fire.
......................................................................................................................................................
H-22
Oracle iDS Forms: Build Internet Applications II
Another way to deal with the event is to add code to the On-Dispatch-Event
trigger.
Restricted or Unrestricted Mode
All event procedures are restricted; that is, go_item cannot be called from
within the procedure code. However, there are instances when the same
event may apply to multiple items and a go_item is necessary; this is the
unrestricted case.
In the unrestricted case, you need to do the following: In the On-DispatchEvent Trigger (block or form level), call:
FORMS4W.DISPATCH_EVENT(RESTRICTED_ALLOWED);
FORMS4W.DISPATCH_EVENT(RESTRICTED_UNALLOWED);
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-23
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
Handling Exceptions
. . .
WHEN FORMS_OLE_FAILURE THEN
ExceptNum :=LAST_OLE_EXCEPTION(errScr,
errDescription, errHelpfile,
errHelpContext);
. . .
Technical Note
The LAST_OLE_EXCEPTION built-in takes variables, not constants.
......................................................................................................................................................
H-24
Oracle iDS Forms: Build Internet Applications II
Handling Exceptions
......................................................................................................................................................
Handling Exceptions
FORMS_OLE_FAILURE Exception
When a failure is detected in handling an ActiveX control method, an FRM
message appears or the FORMS_OLE_FAILURE exception is raised. When
a FORMS_OLE_FAILURE exception is raised, you can get more detailed
information regarding the cause of the exception by calling the
LAST_OLE_EXCEPTION built-in.
/*
Handling the exception raised as a result of calling:
Var_To_Number(To_Variant(Jane));
An exception is raised because Jane is not a number.
*/
DECLARE
errCode
PLS_INTEGER;
errSrc
VARCHAR2(200);
errDescription VARCHAR2(2000);
errHelpfile
VARCHAR2(200);
errHelpContext PLS_INTEGER;
BEGIN
. . .
WHEN form_ole_failure THEN
errCode := LAST_OLE_EXCEPTION(errSrc,
errDescription,
errHelpfile,
errHelpContext);
-- Inform the user of the problem
MESSAGE(errSrc||;||errDescription);
END;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-25
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
......................................................................................................................................................
H-26
Oracle iDS Forms: Build Internet Applications II
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-27
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
.
Summary
......................................................................................................................................................
H-28
Oracle iDS Forms: Build Internet Applications II
Summary
......................................................................................................................................................
Summary
In this lesson, you saw how to include and use ActiveX controls in your
Oracle Developer application.
VBX, OCX, and ActiveX controls
Differences between controls
ActiveX control in Form Builder
Create an ActiveX control
Set and get ActiveX control properties
Invoke ActiveX control methods
Respond to ActiveX control events
Register an ActiveX control
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
H-29
Appendix
H: Working with ActiveX Controls
......................................................................................................................................................
......................................................................................................................................................
H-30
Oracle iDS Forms: Build Internet Applications II
................................
Appendix
I: Using Oracle Server Roles at Run Time
......................................................................................................................................................
SESSION_ROLES
ROLE_ROLE_PRIVS
ROLE_SYS_PRIVS
ROLE_TAB_PRIVS
......................................................................................................................................................
I-2
Oracle iDS Forms: Build Internet Applications II
Description
Name of the role
ROLE_ROLE_PRIVS View
Information about roles granted to other roles
Column
ROLE
GRANTED_ROLE
ADMIN_OPTION
Description
Name of the role
Role that was granted
Subprogram that signifies that the role was granted with the ADMIN
option
ROLE_SYS_PRIVS View
Information about system privileges granted to roles
Column
ROLE
PRIVILEGES
ADMIN_OPTION
Description
Name of the role
System privileges granted to the role
Column that signifies the grant was with the ADMIN option
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
I-3
Appendix
I: Using Oracle Server Roles at Run Time
......................................................................................................................................................
SESSION_ROLES
ROLE_ROLE_PRIVS
ROLE_SYS_PRIVS
ROLE_TAB_PRIVS
......................................................................................................................................................
I-4
Oracle iDS Forms: Build Internet Applications II
ROLE_TAB_PRIVS View
Information about table privileges granted to roles.
Column
ROLE
OWNER
TABLE_NAME
COLUMN_NAME
PRIVILEGE
GRANTABLE
Description
Name of the role
Owner of the object
Name of the object
Name of the column, if applicable
Object privilege granted to the role
YES if the role was granted with the ADMIN option, otherwise NO
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
I-5
Appendix
I: Using Oracle Server Roles at Run Time
......................................................................................................................................................
DBMS_SESSION.SET_ROLE
DBMS_SESSION.IS_ROLE_ENABLED
......................................................................................................................................................
I-6
Oracle iDS Forms: Build Internet Applications II
DBMS_SESSION.SET_ROLE (RoleName)
Description
DBMS_SESSION is a standard
package that comprises many
subroutines. Two of them are used
to manage menu module roles
dynamically.
This package is used to assign a
particular role to the current user.
DBMS_SESSION.IS_ROLE_ENABLED (RoleName)
Example
The following Pre-Form trigger uses the DBMS_SESSION package to test a
users role before allowing access to the application.
IF not (DBMS_SESSION.IS_ROLE_ENABLED(ADMINISTRATIVE) or
(DBMS_SESSION.IS_ROLE_ENABLED(TECHNICAL)
THEN
MESSAGE(You are not authorized to run this application);
PAUSE;
RAISE form_trigger_failure;
END IF;
......................................................................................................................................................
Oracle iDS Forms: Build Internet Applications II
I-7
Appendix
I: Using Oracle Server Roles at Run Time
......................................................................................................................................................
......................................................................................................................................................
I-8
Oracle iDS Forms: Build Internet Applications II