Previous | Table of Contents | Next

Page 442

You should see the new shortcut on your desktop. Double-click the shortcut. You will be prompted for your username, password, and database. If you don't want the user to be prompted for these values, modify the shortcut in this way:

c:\Orawin95\bin\g25run32 openfile=c:\Tyo\Students_by_Year.ogr
Âuserid=flugle/flugle
NOTE
One disadvantage to this shortcut is that the password is contained within the shortcut and could be viewed by others.

The Role of Procedure Builder in the Application Development Process

The last component of Developer/2000 to discuss is Procedure Builder. Procedure Builder is designed to ease the initial development and maintenance of PL/SQL code contained on both the client and the server.

NOTE
Procedure Builder doesn't support the use of PL/SQL Version 2 features such as PL/SQL tables in client-side PL/SQL modules used by Oracle Forms, Reports, or Graphics.

Elements of Procedure Builder

Procedure Builder contains several tools:

Page 443

To invoke Procedure Builder, select Start | Programs | Developer/2000 for Win95 | Procedure Builder. Figure 16.7 shows the initial window displayed by Procedure Builder. Notice that Procedure Builder, like the other components of Developer/2000, supplies an Object Navigator for selecting PL/SQL objects and modifying their properties.

Figure 16.7.
Initial window
displayed by Proce-
dure Builder.

NOTE
Like the other components of Developer/2000, Procedure Builder also uses the Object Navigator. Please refer to the lesson on Day 12 for details on using the Object Navigator.

Before you start using these Procedure Builder tools, you'll want to connect to an Oracle database.

Connecting to an Oracle Database

Connect Procedure Builder to an Oracle database using the method shown in Day 12.

Page 444

Using the Procedure Builder's Object Navigator

The Object Navigator for Procedure Builder functions in the same way as in the other components of Developer/2000. It displays seven object nodes:

In this lesson, you'll focus on Program Units and Database Objects.

Program Unit Editor

You can use the Program Unit Editor to view, create, modify, and delete packages, procedures, and functions. You can invoke the Program Unit Editor by selecting Tools | Stored Program Unit Editor from the menu. For example, to create a new function, click New; a window will appear, prompting you for the name and type of the program unit (see Figure 16.8). After you click OK, the Program Unit Editor creates a template for the function, as shown in Figure 16.9).

PL/SQL Interpreter

You can invoke the PL/SQL Interpreter by selecting Tools | PL/SQL Interpreter from the menu. The PL/SQL Interpreter operates in two states:

Page 445

Figure 16.8.
Creating a new
function with the
Program Unit Editor.

Figure 16.9.
Function template
created by the
Program Unit Editor.

Page 446

Figure 16.10.
sing the PL/SQL
Interpreter to enter
and execute an
anonymous block.

Stored Program Unit Editor

You can use the Stored Program Unit Editor to view, create, modify, and delete packages, procedures, and functions that are stored in an Oracle database. To use the Stored Program Unit Editor, you must already be connected to an Oracle database. You can invoke the Stored Program Unit Editor by selecting Tools | Stored Program Unit Editor from the menu.

When the editor window appears, you'll notice that there are two fields at the top of the window: Owner and Name. The Owner text box contains a dropdown list of the Oracle users that exist in the database to which Procedure Builder is connected. The Name text box contains a list of stored program units that are owned by the Oracle user displayed in Owner. For example, Figure 16.11 illustrates how you select a particular stored program unit in the Name text box after you have specified the Oracle user, which is flugle.

NOTE
Not every Oracle user owns packages, procedures, and functions; some Oracle users won't own any. In that case, Procedure Builder will display (None) in Name. Also, your ability to create and modify stored program units owned by your own Oracle account or others will depend on the system and object privileges possessed by your Oracle account.

Page 447

Figure 16.11.
Viewing a stored
function with the
Stored Program Unit
Editor.

Database Trigger Editor

There are two ways to invoke the Database Trigger Editor: you can use the Object Navigator to view or modify an existing database trigger, or you can select Tools | Database Trigger Editor from the menu.

To use the Object Navigator to view or modify an existing database trigger, expand the Database Objects node; the Object Navigator will display a list of Oracle accounts. If you select an Oracle account and expand it, you will see another level of nodes, including Stored Program Units, Libraries, Tables, and Views (see Figure 16.12).

If you expand the Tables node, a list of the tables owned by the selected Oracle account will appear. If you select a table and expand the node, you will see two nodes beneath the table: Triggers and Columns. Expand the Triggers node and double-click the icon to the left of a specific trigger.

Previous | Table of Contents | Next

Используются технологии uCoz