tailieunhanh - Teach Yourself PL/SQL in 21 Days- P2

Teach Yourself PL/SQL in 21 Days- P2: Welcome to Sams Teach Yourself PL/SQL in 21 Days, Second Edition. The fact that you purchased this book indicates that you have an interest in learning the PL/SQL language, which is Oracle’s relational database procedural programming language. It allows you to develop powerful and complex programs to access and manipulate data in the Oracle8i database. We have attempted to include as many examples of PL/SQL code as possible to illustrate PL/SQL features | Learning the Basics of PL SQL 27 Figure Creating a New Program Unit. 1 Figure Entering the code for SSTHRESH. SS_THRESH INPUT When you execute this statement Procedure Builder will execute the function and dis- play the following results OUTPUT 72600 Connecting to a Database In addition to creating PL SQL program units on the client Procedure Builder can also be used to create and execute program units in a database. To do this you first need to connect to a database. Use the File Connect menu option to connect to a database. Once you ve logged in you will be able to browse database program units using the Object Navigator. Figure shows the program units owned by the user named JEFF. 28 Day 1 Figure Program units in the JEFF schema. The Create Toolbar button To create a stored function or other program unit in the database follow these steps 1. Click to highlight the Stored Program Units entry under the user s name. 2. Click the Create Toolbar button. 3. Proceed as you would when creating a local program unit. Except for having to choose the schema the process for creating a PL SQL function in the database is the same as for creating one locally. Using SQLPlus Worksheet If you have Enterprise Manager available consider using SQLPlus Worksheet for the examples in this book. SQLPlus Worksheet is completely compatible with SQL Plus and can be used for all the examples in this book. The advantage that SQL Plus worksheet has over SQL Plus is in the interface. Rather than type in large blocks of code one line at a time you can use a text editor-like interface. After you get the code entered the way that you want it you can click a toolbar button to execute it. Executing a PL SQL Block Using SQLPlus Worksheet Figure shows the SQLPlus Worksheet. Learning the Basics of PL SQL 29 Figure The SQLPlus Worksheet. The Execute Button The Entry Pane The Output Pane As you can see the SQLPlus Worksheet screen is divided into two halves. The .

TÀI LIỆU LIÊN QUAN
TỪ KHÓA LIÊN QUAN