Presentation is loading. Please wait.

Presentation is loading. Please wait.

DataBase Logic in Business Applications

Similar presentations


Presentation on theme: "DataBase Logic in Business Applications"— Presentation transcript:

1 DataBase Logic in Business Applications
Al.I. Cuza University of Iași Faculty of Economics and Business Administration Department of Accounting, Information Systems and Statistics DataBase Logic in Business Applications Introduction to Oracle PL/SQL By Marin Fotache & Co.

2 The Need for Code SQL is the universal data language (“intergalactic dataspeak”  M. Stonebraker) SQL acceptance is mainly due to its “declarativity”, i.e. you don’t need to code anything, but to just specifiy what data you neeed For a while (SQL-89 and SQL-92), SQL was purely declarative In SQL:1999 standard PSM (Persistent Stored Modules) was added Real-world applications require procedures performing tasks not possible using only SQL statements (UPDATE, SELECT, …)

3 SQL Procedural Extensions
Main database servers implemented procedural SQL extensions (programming languages for databases) since early 1990s Procedural extensions used to be very different in syntax; in recent years similarities have increased among languages Every DB server has one or more programming languages for writing/developing code to be launched on the DB server – stored procedures Stored procedures (procedures, functions, packages, triggers) are part of the database

4 Examples of programming languages available in some DB servers
Oracle: PL/SQL, Java, C, C++, C#, Visual Basic, COBOL IBM DB2: SQL PL, C++, COBOL, Fortran, Java, Perl, PHP, Python, Ruby/Ruby on Rails, REXX, C#, VB .NET and other .NET languages Microsoft SQL Server: Transact SQL (T-SQL), C# VB .NET and other .NET languages PostgreSQL: PL/Java (Java), PL/PHP (PHP), PL/Py (Python), PL/R (R), PL/Ruby (Ruby), PL/Scheme (Scheme), PL/sh (Unix shell)

5 PL/SQL The main language for programming Oracle database applications
Our main focus for this semester Easy to understand, even by non- programmers Does not provide the richness of other languages of C#, Java, Python, C++ etc. because it addressed maily the data processing in Oracle Simplicity makes it very easy-to-learn and stable

6 Oracle PL/SQL Code PL/SQL code is organized in blocks
Anonymous blocks are stored outside the database in text (usually .sql) files Named blocks reside with the database – stored procedures: Procedures Functions Packages User-defined packages System packages Triggers

7 Useful Resources on Basic PL/SQL
Getting started PL/SQL tutorial PL/SQL Tutorial (TutorialsPoint) pl/sql tutorial PL/SQL Tutorial Fotache et. 2003, Fotache 2009 (in Romanian) - uploaded on FEAA portal) An older video-tutorial (in Romanian): 03_Primele blocuri PL SQL.mp4 QeD_S

8 First PL/SQL topics in recommended tutorials
Block Structure Data Types Variable & Scope Constant Declaration Comments Conditional Control Loop Statement Sequential Control Case Statement Functions Procedures

9 Video-tutorials on Basic PL/SQL
PL1 PL SQL Tutorial Introduction to PL SQL programming PL2 PL SQL Tutorial Declaration Section Theory) PL3 PL SQL Tutorial Declaration Section Hands On) PL4 PL SQL Tutorial Displaying Strings and Assignment Theory) PL5 PL SQL Tutorial DBMS OUTPUT and Assignment Hands On) PL6 PL SQL Tutorial Programs to Try based on PL1 PL5 PL7 PL SQL Tutorial SELECT statements in PL SQL blocks Theory)

10 Video-tutorials on Basic PL/SQL (cont.)
PL8 PL SQL Tutorial Select statements in a PL SQL block Hands On) PL9 PL SQL Tutorial DML and TCL statements Theory) PL10 PL SQL Tutorial DML and TCL statements Hands On) PL11 PL SQL Tutorial IF statements in PL SQL Theory) PL12 PL SQL Tutorial IF statements in PL SQL Hands On) PL13 PL SQL Tutorial CASE Statement in PL SQL Theory) PL14 PL SQL Tutorial CASE Statement in PL SQL Hands On) PL15 PL SQL Tutorial LOOP END LOOP statement Theory)

11 Video-tutorials on Basic PL/SQL (cont.)
PL16 PL SQL Tutorial Loop Statement Hands On)) PL17 PL SQL Tutorial WHILE LOOP construct Theory) PL18 PL SQL Tutorial While Loop Statement Hands On) PL19 PL SQL Tutorial For LOOP construct Theory) PL20 PLSQL Tutorial FOR LOOP in PL SQL Hands On) See also video-tutorials from PLS-1 to PLS-8 in the playlist: eload=10


Download ppt "DataBase Logic in Business Applications"

Similar presentations


Ads by Google