300 likes | 545 Views
Developer 2000. CSE 4504/6504 Lab. Developer 2000. A group of tools for developing Client/Server application. Two important tools: Form Builder -- For designing data entry forms. Report Builder -- For designing reports. . How to run the tools in ra?.
E N D
Developer 2000 CSE 4504/6504 Lab
Developer 2000 • A group of tools for developing Client/Server application. • Two important tools: Form Builder -- For designing data entry forms. Report Builder -- For designing reports.
How to run the tools in ra? • Enter swsetup oradev to add the Oracle 8.0 developer 2000 design tools to your path • f60desm to start the Form Builder • f60runm to run the executable form file
What is Form Builder? • Form is a window the user interacts with. • Form Builder is a tool that can do most of the development without a great deal of coding.
Main Components in Form Builder • Object Navigator • Property palette • Layout editor • PL/SQL editor
Layout Editor To design the outlook of the interface.
Property Palette Click the control component and press mouse right key, then select the option ‘Property Palette’.
PL/SQL Editor PL/SQL Editor is where all PL/SQL code can be added, modified, removed, and compiled.
Log into Database Put your user name and password (same as sqlplus), and click connect.
Create a single block form • In general, a Data Block on a form corresponds to a table or a view in the database. This is called the Base Table for the data block. • A canvas is the place to show the data in data block. • Create a module named “orders”.
Step 1 create a data block for table department 1.In the Module you want to add a block, right click on the Data blocks, select Data Block wizard in the popup menu. 2.select a table from database and add all columns
Step 2 create Layout for data block department • 1.In menu Tools click the Layout wizard • 2.The layout for a data block may be placed on any existing canvas. In this case, there are no canvases so the only option available is to create a new canvas. • 3.select the data block and add all columns • 4.select style There are two main styles for forms. A Tabular layout arranges the field labels across the top of the form with a number of records below as in a spreadsheet. A Form layout places the field labels to the left of the fields. Generally only one record is displayed at a time. • 5.select the title and the num of record showed at the same time.
Step 3 run the form In menu program click run form, a execution window will pop up. In the menu bar “Query”, click on “enter query”, then click on “execute query”, the data requested will be displayed in the blocks.
Step 4 Do a simple query on a condition Change the property of data block ORDERS to do a simple query • Right click on data block ORDERS • Select property palette • Change where property to ORDERDATE > ’01-AUG-2000’ • Run the form again to see the changes
Smart Trigger “when-new-form-instance” In the PL/SQL editor: execute_query; The query will be automatically executed when the form runs.
Create a Master-Detail Form • The Master-Detail relationship is a common relationship between entities. In an Entity-Relationship diagram, these are shown as "One to Many" relationships. In a physical database design, a single Master record references one or more detail records in another table. A record in the detail table will relate to exactly one master record in the master table. • It is based on a single data block created before.
Create a Master-Detail Form (cont.) Step1 create a master data block for ORDERS Create a single block form whose data block is associated with master table Step 2 create the layout for data block ORDERS Same as before
Create a Master-Detail Form (cont.) Step 3 create a detail data block for ORDERS • Use data block wizard to create the relationship • De-select the Auto-join data blocks option • Arrange the Detail Item (ORDERID) and Master Item (ORDERID) as that the join condition becomes: ORDER_ITEM.ORDERID =ORDER_.ORDERID
Create a Master-Detail Form (cont.) Step 4. create the layout for data block employee. Don’t create a new layout, select the layout for data block ORDERS. Others are the same.
Create a Menu • Creating the menu module and menu items • Assigning commands to menu items • Attaching a menu module to a form
Create a menu (cont.) Step 1 Creating a menu module and menu items Navigate down to the Menus subtree in the Object Navigator, pull down the Navigator menu and choose the Create “new menu” item Right click your module named as “MENU_TRY”, select menu editor, add three menu item: orders, customers, exit in the menu editor.
Create a menu (cont.) Step 2 Assigning commands to menu items right click the menu item select PL/SQL editor • Add in exit: EXIT_FORM; • Add in orders: BEGIN run_product(forms,'orders',synchronous,runtime,filesystem,'',''); exit_form; END; • Add in employee: BEGIN run_product(forms,‘customer',synchronous,runtime,filesystem,'',''); exit_form; END; Note : the module name (form file name) is case sensitive.
Create a menu (cont.) Step 3 Attach a menu module to a form • Before you use the menu, you must compile it. To compile the menu, highlight the module in file menu, select “administration” from menu “File” then select “compile file”. • Menu module name is the file name of the menu. For example, MAIN_MENU.mmb • In the property palette of the form “orders” (the form you want to attach the menu to), input your menu module name in menu_module property.