1 R. Ching, Ph.D. MIS Area California State University, Sacramento Week 2 February 1 PL/SQLPL/SQL Creating a FormCreating a Form.

Slides:



Advertisements
Similar presentations
AN INTRODUCTION TO PL/SQL Mehdi Azarmi 1. Introduction PL/SQL is Oracle's procedural language extension to SQL, the non-procedural relational database.
Advertisements

PL/SQL.
The Web Warrior Guide to Web Design Technologies
Copyright Ó Oracle Corporation, All rights reserved Sharing Objects and Code.
PL/SQL (Procedural Language extensions to SQL) Prepared by: Manoj Kathpalia Edited by: M V Ramakrishna.
Lecture-5 Though SQL is the natural language of the DBA, it suffers from various inherent disadvantages, when used as a conventional programming language.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Automating Tasks With Macros
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
1 R. Ching, Ph.D. MIS Area California State University, Sacramento Week 10 April 5 Subquery and ThresholdsSubquery and Thresholds Graphics Builder and.
Introduction to PL/SQL
Eyad Alshareef 1 Creating Custom Forms Part A. 2Eyad Alshareef Data Block and Custom Forms Data block form Data block form Based on data blocks that are.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction To Form Builder
1 Chapter 5: Introduction To Form Builder. 2 Forms  Why Do We Use Form Builder?  Why Don’t We Use SQL Only?!
14 Copyright © 2004, Oracle. All rights reserved. Producing Triggers.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
23 Copyright © 2004, Oracle. All rights reserved. Sharing Objects and Code.
PL / SQL P rocedural L anguage / S tructured Q uery L anguage Chapter 7 in Lab Reference.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
Bordoloi and Bock EXCEPTIONS. Bordoloi and Bock Errors Two types of errors can be found in a program: compilation errors and runtime errors. There is.
Reusable Code For Your Appx Processes Presented By: Gary Rogers.
Microsoft Visual Basic 2005: Reloaded Second Edition
Tutorial 11 Using and Writing Visual Basic for Applications Code
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Forms - An Overview of Oracle Form Builder v.6.0 Abhishek Parag Prashant Arun.
Lecture 4 PL/SQL language. PL/SQL – procedural SQL Allows combining procedural and SQL code PL/SQL code is compiled, including SQL commands PL/SQL code.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 2 Basic PL/SQL Block Structures.
INTRODUCTION TO PL/SQL. Class Agenda Introduction Introduction to PL/SQL Declaring PL/SQL Variable Creating the Executable Section Interacting with the.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
University of Sunderland COM 220 Lecture Six Slide 1 Building Interactive Forms Applications using Oracle.
Overview · What is PL/SQL · Advantages of PL/SQL · Basic Structure of a PL/SQL Block · Procedure · Function · Anonymous Block · Types of Block · Declaring.
1 Chapter 12: Form Builder Objects and Flexible Code.
PL / SQL By Mohammed Baihan. What is PL/SQL? PL/SQL stands for Procedural Language extension of SQL. PL/SQL is a combination of SQL along with the procedural.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
PL/SQL Block Structure DECLARE - Optional Variables, cursors, user-defined exceptions BEGIN - Mandatory SQL Statements PL/SQL Statements EXCEPTIONS - Optional.
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
Database Application Development using PL/SQL Programming.
Guide to Oracle 10g ITBIS373 Database Development Lecture 4a - Chapter 4: Using SQL Queries to Insert, Update, Delete, and View Data.
Copyright Ó Oracle Corporation, All rights reserved Producing Triggers.
1 PL/SQLPL/SQL Declaring Variables Declaring Variables Declaring Variables Declaring Variables Writing Executable Statements Writing Executable Statements.
Oracle 8i Exception Handling. General Syntax DECLARE --- BEGIN --- EXCEPTION WHEN exception_name1 THEN -Error handling statements WHEN exception_name2.
1 PL\SQL Dev Templates. 2 TEMPLATE DEFINITION Whenever you create a new program unit, its initial contents are based upon a template which contains pre-defined.
Using SQL in PL/SQL ITEC 224 Database Programming.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Chapter 16 Cursors and Exceptions. Chapter Objectives  Determine when an explicit cursor is required  Declare, open, and close an explicit cursor 
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
1 R. Ching, Ph.D. MIS Area California State University, Sacramento Week 4 February 15 LOV: List of ValuesLOV: List of Values Dealing with Errors and ProblemsDealing.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
1 R. Ching, Ph.D. MIS Area California State University, Sacramento Week 13 April 26 Pseudo Drill-Down GraphsPseudo Drill-Down Graphs.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
CS422 Principles of Database Systems Oracle PL/SQL Chengyu Sun California State University, Los Angeles.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Oracle Developer/2000.
Forms Concepts Triggers Fired when Internal/External events occur
Working with Data Blocks and Frames
Working in the Forms Developer Environment
Developer 2000 CSE 4504/6504 Lab.
Lexical Reference Variables in Graphics and List Box in Forms
Microsoft Access Illustrated
Producing Triggers Schedule: Timing Topic 40 minutes Lecture
Chapter 8: Creating An Integrated Database Application
Presentation transcript:

1 R. Ching, Ph.D. MIS Area California State University, Sacramento Week 2 February 1 PL/SQLPL/SQL Creating a FormCreating a Form

2 R. Ching, Ph.D. MIS Area California State University, Sacramento Coding Standards Element names (functions, objects, variables, etc.): 30- character maximum lengthElement names (functions, objects, variables, etc.): 30- character maximum length Uppercase letters for keywordsUppercase letters for keywords Lowercase letters for user-defined elementsLowercase letters for user-defined elements 80 characters per line80 characters per line –One command per line CommentsComments –Header comments: /* comment */ –Inline comments: -- comment Prefix object namesPrefix object names

3 R. Ching, Ph.D. MIS Area California State University, Sacramento PL/SQL Processing Language/SQL Procedural processing language for various Oracle tools:Procedural processing language for various Oracle tools: –Forms –Reports –Graphics Character setCharacter set –Alphabetic, numeric and special characters –Arithmetic and relational operators –Others (;,., :=, | |, --, /* */)

4 R. Ching, Ph.D. MIS Area California State University, Sacramento PL/SQL Block Declaration Section Executable Section Exception Section Exception Section Declares variables and constants (optional). Procedural programming Defines the exception handlers invoked for both predefined and user-defined exceptions (optional).

5 R. Ching, Ph.D. MIS Area California State University, Sacramento PL/SQL Block Declare section Exception section Executable section

6 R. Ching, Ph.D. MIS Area California State University, Sacramento PL/SQL Declaration Section Declare variable and constant names and typesDeclare variable and constant names and types Data typesData types –Character (varchar2) –Numeric –Date –Boolean

7 R. Ching, Ph.D. MIS Area California State University, Sacramento Variable and Constant Declaration Defines the existence of all variables used in the procedure... declare variable-name data-type; constant-name := value;Defines the existence of all variables used in the procedure... declare variable-name data-type; constant-name := value; –For example... declare line_count number; product_request varchar2(10); max_count := 20; Data types Constant

8 R. Ching, Ph.D. MIS Area California State University, Sacramento For Example... declare product_request varchar2(3); product_descrip varchar(30); price real; cursor product is select product_description, product_msrp from products where manufacturer_code = product_request;...begin; open product; loop fetch product into product_descrip, price;... close product; Order of variables must match the order in the select Query assigned to “product”

9 R. Ching, Ph.D. MIS Area California State University, Sacramento Executable Section Types of statementsTypes of statements –Assignment –Flow-of-control –SQL –Cursor All statements must be terminated by a semi-colon (;)All statements must be terminated by a semi-colon (;)

10 R. Ching, Ph.D. MIS Area California State University, Sacramento Exception Section Instructs PL/SQL how to handle particular exceptions exception when exception-name then PL/SQL statements; when exception-name then PL/SQL statements; end;Instructs PL/SQL how to handle particular exceptions exception when exception-name then PL/SQL statements; when exception-name then PL/SQL statements; end;

11 R. Ching, Ph.D. MIS Area California State University, Sacramento Exception Names Predefined - Defined in OraclePredefined - Defined in Oracle –DUP_VAL_ON_INDEX (duplicate value on a unique index) –INVALID_NUMBER –NO_DATA_FOUND (no rows returned) –TOO_MANY_ROWS (multiple rows returned) –VALUE_ERROR User-defined - Defined in the declarations as an exception (data type).User-defined - Defined in the declarations as an exception (data type).

12 R. Ching, Ph.D. MIS Area California State University, Sacramento Oracle Developer Oracle Developer Forms (interactive)Forms (interactive) –Presenting information and entering data online Reports (reporting)Reports (reporting) –Page-oriented display of information Graphics (charts)Graphics (charts) –Graphic representation of data

13 R. Ching, Ph.D. MIS Area California State University, Sacramento

14 R. Ching, Ph.D. MIS Area California State University, Sacramento Forms Designer Four major componentsFour major components –Object Navigator –Layout editor –Property palette (sheet) –PL/SQL editor

15 R. Ching, Ph.D. MIS Area California State University, Sacramento  Object Navigator Forms module with various objects Modules Modules: FormsForms MenuMenu LibrariesLibraries Built-in PackagesBuilt-in Packages Database ObjectsDatabase Objects

16 R. Ching, Ph.D. MIS Area California State University, Sacramento Toolbar Object type Hierarchy Specifies the order in which objects and items are executed Menus

17 R. Ching, Ph.D. MIS Area California State University, Sacramento Window and Canvas Objects Window Canvas-View Interface Item Boilerplate objects (lines, images, boxes, etc.) Canvas-View Four types of canvas-views: Content, Stacked, Horizontal Toolbar, and Vertical Toolbar

18 R. Ching, Ph.D. MIS Area California State University, Sacramento Window-Canvas-Block-Items Relationship Window Canvas-View Block Items PL/SQL Menu object

19 R. Ching, Ph.D. MIS Area California State University, Sacramento  Layout Editor Tool palette Tool bar Layout work area Rulers

20 R. Ching, Ph.D. MIS Area California State University, Sacramento  Property Palette  Property Palette Properties of the canvas Set an object’s attributes

21 R. Ching, Ph.D. MIS Area California State University, Sacramento Triggers TriggerTrigger

22 R. Ching, Ph.D. MIS Area California State University, Sacramento  PL/SQL Editor Trigger List of triggers PL/SQL code

23 R. Ching, Ph.D. MIS Area California State University, Sacramento Inheriting Properties Stereos to Go! Enter Exit View Report Graph Exit Class Properties

24 R. Ching, Ph.D. MIS Area California State University, Sacramento Creating a Property Class Create a Property Class object in the parent moduleCreate a Property Class object in the parent module Add the property and its valuesAdd the property and its values Select the object in the childSelect the object in the child –Under Subclass Information, specify the property class

25 R. Ching, Ph.D. MIS Area California State University, Sacramento Create the Property Class in the Parent

26 R. Ching, Ph.D. MIS Area California State University, Sacramento Add the Properties to the Class Added to the class

27 R. Ching, Ph.D. MIS Area California State University, Sacramento Inherit the Property Class in the Child  Select the object and its Property Palette  Select Subclass Information  Specify the object or property class name and its form module Parent module Property class

28 R. Ching, Ph.D. MIS Area California State University, Sacramento Menus  Menus Menu items  File Menu

29 R. Ching, Ph.D. MIS Area California State University, Sacramento Menu Module  Menu module  Menu object Menu items Five Simple Steps:  Create the menu module  Add the menu objects  Add the menu items to the menu objects  Program the items in PL/SQL  Attach the menu module to the form module

30 R. Ching, Ph.D. MIS Area California State University, Sacramento Why Multiple Forms? Build more functional units (forms)Build more functional units (forms) –Design the form to support a narrow scope of functions –Reduce the complexity of a single form Reduce the time to develop and implement an applicationReduce the time to develop and implement an application Enhance maintainability of the application (plug-and-play!)Enhance maintainability of the application (plug-and-play!) Promotes reusability or cloningPromotes reusability or cloning

31 R. Ching, Ph.D. MIS Area California State University, Sacramento Calling and Called Forms          CallingCalled The calling form module transfers control (calls, opens) to the called formThe calling form module transfers control (calls, opens) to the called form CALL_FORM (form-module-name,display,switch-menu) –Calling form remains present behind the called form –Called module assumes the calling module’s menu module

32 R. Ching, Ph.D. MIS Area California State University, Sacramento Calling and Called Forms Upon exit of the called form, control returns to the calling formmoduleUpon exit of the called form, control returns to the calling formmoduleEXIT_FORM          CallingCalled

33 R. Ching, Ph.D. MIS Area California State University, Sacramento Calling a Form Module Create or select an item (i.e., push button) on the canvas or in the menu moduleCreate or select an item (i.e., push button) on the canvas or in the menu module Program the item in the PL/SQL EditorProgram the item in the PL/SQL Editor –Select a trigger that will activate the procedure –Enter the CALL_FORM statement –Compile the code Test the form moduleTest the form module

34 R. Ching, Ph.D. MIS Area California State University, Sacramento Causes Oracle Forms to clear the calling form from the screen before drawing the called form. HIDE is the default parameter. (NO_HIDE) Form module name Causes Oracle Forms to keep the default menu application of the calling form active for the called form. (REPLACE) In the PL/SQL Editor

35 R. Ching, Ph.D. MIS Area California State University, Sacramento NEW_FORM NEW_FORM closes the calling formNEW_FORM closes the calling form Greeting Screen Main Menu QueryQuery NEW_FORM EXIT_FORM EXIT_FORM MenuMenu CALL_FORM

36 R. Ching, Ph.D. MIS Area California State University, Sacramento