|
CREATING TABLES
Creating Database Tables
Before you can run any database application, you have to create the corresponding
relational tables. You have to then be connected to the account that has the
corresponding tables before running an application. In order to create these
tables needed to run Sample.fmb, we need to run a script called SUMMIT2.sql.
Please download SUMMIT2.sql
here
to the folder C:\Temp and execute the following command:
SQL>@c:\temp\summit2.sql [don't use a
semicolon]
After the commands are executed, you will
see a message - Tables and sequences created and populated. Let us know if
you see any error message.
Examining Database Tables
There are two ways to examine these tables.
One is via the Object Navigator in Forms Builder and the other is via the
SQL interface.
Click on Start - Programs – Oracle9i
Developer Suite - Forms Developer - Forms Builder
You will now be in the Object Navigator.
First connect to your database account on the Oracle server. In the Object
Navigator, click on File \ Connect to connect to the database. You will use
the user name and password and database (devdb) as before. At the bottom of the Object Navigator
screen you can expand the Database Objects icon. You will see a list of tablespaces. Now expand your tablespace which is under your username. If you
expand the Tables icon, you should now see a list of table names S_CUSTOMER,
S_ORDER, etc. You can also expand each table to examine the columns of that
table.
You can also examine the tables by
selecting the SQL tool and executing the following query:
SQL>select * from tab; [remember the
semicolon]
You should now see the same list of table
names S_CUSTOMER, S_ORDER, etc.
SQL> select * from s_customer; will
display all the customer data, etc.
SQL> desc s_customer; will display
information about all the columns. Compiling/Running "Sample"
within Forms Builder
A sample application is found in Sample.fmb
- this is the name of the file in which the forms-based application has been
saved. The extension .fmb is for the uncompiled form and .fmx is for the
compiled form. Download Sample.fmb
here
to C:\Temp.
YOU MUST START THE OC4J INSTANCE BEFORE YOU CAN RUN
SAMPLE.FMB.
Click on Start - Programs – Oracle9i
Developer Suite - Forms Developer - Start OC4J Instance
A command window with the title "Start OC4J
Instance" opens.
Now load the form "Sample.fmb" from the
local folder. From Object Navigator, click on File / Open. Then select the
folder where you saved the file Sample.fmb. You can return to the Object
Navigator examine all the elements Sample.fmb at your leisure.
To run the sample application in
"Sample.fmb", use the Run icon located in the left panel of the Object
Navigator or Program / Run Form. When you run the form, it will
automatically compile the application.
Make sure you can run this form
"Sample.fmb". Let us know if you have errors when running this application.
Working in a Client-Server environment
Everybody has an Oracle account (your professor will provide this
information) which is password protected. Your database (tables and all
other related catalog information) will be resident on the Oracle Server.
The Oracle Server creates a separate tablespace for each Oracle user and
this is password protected. These files cannot be moved outside the Oracle
server.
Your forms filename.fmb and filename.fmx
etc. will be resident on the Smith Server K-drive or the local computer C
drive. Please make sure that you manage these files as you manage any other
files.
During the course of these tutorials you
will look at, build and modify several sample "forms" Sample.fmb,
starter.fmb, newsample.fmb, etc. Make sure that you backup these files as
you modify them.
Oracle Online Help
There is a very detailed HELP capability
within the Forms Builder tool. Select the Help button from the Forms Builder
and Forms Builder Help Topics, and you will get help documentation for all
kinds of topics.
Bugs and Fixes
The class web page will periodically be
updated with additional tutorial material, sample applications, answers to FAQs,
bug fixes, etc.
|