http___www.knjiga.ba_racunari_baze-podataka_oracle-10g-pl-sql-programiranje-k0624.html_1.xml
1.1 2.1 3.1 3.2 3.3 4.1 5.1 6.1 6.2 7.1 8.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 16.1 16.2 17.1 18.1 18.2 18.3 18.4 18.5 18.6 18.7 19.1 20.1 20.2 20.3 20.4 20.5 21.1 21.2 21.3 22.1 23.1 23.2 24.1 25.1 26.1 26.2 26.3 26.4 27.1 28.1 28.2 29.1 29.2
Part I: Programming in PL/SQL Part I of this book introduces PL/SQL and presents the basics of how to program in Oracle-based applications. Chapter 1, Introduction to PL/SQL, introduces PL/SQL and explains where it came from. It describes the various PL/SQL versions and environments you might be using and the differences among the implementations of PL/SQL. It also presents some basic PL/SQL programming principles. Chapter 2, PL/SQL Language Fundamentals, introduces the PL/SQL character set, identifiers, literals, and other basic elements of the language. Chapter 3, Effective Coding Style, presents guidelines for coding style and discusses how the decisions you make about the formatting of your programs can determine how readable and useful those programs can be. Copyright (c) 2000 O'Reilly & Associates. All rights reserved. Introduction to PL/SQL Contents: What Is PL/SQL? The Concept of Programming in Oracle Applications The Origins of PL/SQL PL/SQL Versions Advice for Oracle Programmers A Few of My Favorite (PL/SQL) Things Best Practices for PL/SQL Excellence This chapter introduces PL/SQL, its origins, and its various versions. It also introduces you to what it means to be a PL/SQL programmer, and how PL/SQL programming differs from the kind of programming with which you may be familiar. 1.1 What Is PL/SQL? PL/SQL stands for "Procedural Language extensions to SQL." PL/SQL is available primarily as an "enabling technology" within other software products; it does not exist as a standalone language. You can use PL/SQL in the Oracle relational database, in the Oracle Server, and in client-side application development tools, such as Oracle Forms. PL/SQL is closely integrated into the SQL language, yet it adds programming constructs that are not native to this standard relational database language. As you can see from the following code example, PL/SQL allows you to combine SQL statements with "standard" procedural constructs. This single program can either insert a company into or delete a company from the database. It relies on the IF statement (not a SQL statement) to determine which action to take: PROCEDURE maintain_company (action_in IN VARCHAR2, id_in IN NUMBER, name_in IN VARCHAR2 := NULL) IS BEGIN IF action_in = 'DELETE' THEN DELETE FROM company WHERE company_id = id_in; ELSIF action_in = 'INSERT' THEN INSERT INTO company (company_id, name) VALUES (id_in, name_in); END IF; END; PL/SQL is an unusual -- and an unusually powerful -- programming language. You can write programs that look just like traditional 3GL modules, but you can also include calls to SQL statements, manipulate data through cursors, and take advantage of some of the newest developments in programming languages. PL/SQL supports packages which allow you to perform object-oriented design. PL/SQL provides a powerful mechanism for trapping and, with exception handlers, resolving errors. The tight integration of PL/SQL with SQL provides developers with the best of both worlds -- declarative and procedural logic. Figure 1.1 shows how PL/SQL fits within the client-server architecture of Oracle-based applications. It shows both an Oracle Forms client and a non-Oracle tool client, both executing against an Oracle Server database. Notice that the Oracle Forms client makes use of two versions of PL/SQL: PL/SQL Release 1.1: a client-side PL/SQL engine that allows the application to execute local PL/SQL programs PL/SQL Release 2. X: the server-based PL/SQL engine that executes stored programs The third-party tool executes calls to stored programs, which are then run on the server. Figure 1.1: PL/SQL within the Oracle client-server architecture Because PL/SQL is used both in the database (for stored procedures and database triggers) and in the application code (to implement logic within a form, for example), you can leverage the same programming language for both client-side and server-side development. You can even move programs from one component of the configuration to another.[1] For example, you might decide that a function which was originally coded for a single screen could be shared by all of the modules in an application. To make this happen, you simply move that function from the client-side screen component to the server-side database environment. You have to change neither the PL/SQL code nor any of the programs that call that function. [1] As long as there are no conflicts between different versions of PL/SQL. Of course, as an underlying technology in the Oracle constellation of products, PL/SQL is just one element of the total programming experience. In fact, building an Oracle-based application requires a combination of technology and techniques, as you'll see in the next section. Copyright (c) 2000 O'Reilly & Associates. All rights reserved.
1.1 2.1 2.2 2.3 2.4 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 11.1 12.1 13.1 14.1 14.2 14.3 15.1 16.1 17.1 18.1 19.1 20.1 21.1 22.1 23.1 24.1 25.1 26.1 27.1 28.1 29.1 30.1 31.1 32.1 33.1 34.1 35.1 36.1 37.1 38.1
Detalji Napravite dinamičke klijent/server aplikacije koristeći PL/SQL i obimne informacije koje ćete pronaći u ovoj knjizi. Stručnjaci za Oracle opisuju osobine PL/SQL-a, objašnjavaju semantiku i sintaksu pitanja skripta i detaljno objašnjavaju funkcionalnost PL/SQL-a baze podataka Oracle 10g. Naučićete kako da napravite moćne PL/SQL programe, komunicirate sa bazama podataka Oracle, obavljate složena izračunavanja i obrađujete greške. Osim toga, dobićete savjete za programiranje i tehnike koje možete upotrijebiti, i praktične primjere iz svijeta Oraclea. - Napravite, podesite i debagujte PL/SQL programe u različitim okruženjima pomoću kojih se radi sa bazama podataka Oracle. Koristite PL/SQL blokovske strukture, promenljive, tipove podataka, izraze, operatore i iskaze. - Kontrolišite i oporavite bazu podataka od grešaka koristeći izuzetke i rutine za obradu grešaka. - Prosledite podprograme, procedure, funkcije, pakete i okidače. Ostvarite komunikaciju između sesija pomoću paketa DBMS_PIPE i DBMS_ALERT. - Napravite objektno-orijentisane PL/SQL aplikacije. - Obrađujte velike skupove podataka koristeći slogove i objekte PL/SQL-a. - Koristite Oracle Net Services, spoljašnje procedure, Java biblioteke i deljene bibilioteke koje su napravljene u programskom jeziku C. - Ostvarite objektno-orijetisano programiranje pomoću privremenih objekata, nasleđivanja, evoluiranja tipova podataka i promene atributa. - Automatizujte poslove baze podataka pomoću paketa DBMS_JOB i DBMS_SCHEDULER, a funkcionalnost prosledite elektronskom poštom pomoću paketa UTL_SMTP i UTL_MAIL. O autorima Skot Urman autor čije se knjige nabolje prodaju, član je tima za dijagnostiku i otklanjanje problema u Oracle korporaciji. Ron Hardmen, OCP viši analitičar podataka, Oracle Support Services. Majkl MekLaflin, D.CS. viši menadžer nadogradnje aplikacija, Oracle Application Development. Kratak sadržaj Deo I: Uvod 1 Uvod u programski jezik PL/SQL 2 Korišćenje alata SQL*Plus i JDeveloper 3 Osnove programskog jezika PL/SQL 4 Upotreba programskih jezika SQL i PL/SQL 5 Slogovi 6 Kolekcije 7 Obrada grešaka 8 Pravljenje procedura, funkcija i paketa 9 Upotreba procedura, funkcija i paketa Okidači baze podataka Deo II: Napredne osobine programskog jezika PL/SQL Komunikacija između sesija Spoljašnje rutine Dinamički SQL Uvod u objekte Objekti baze podataka Veliki objekti Planiranje poslova Deo III: Dodaci A Rezervisane reči programskog jezika PL/SQL B Vodič kroz ugrađene pakete Indeks