SlideShare une entreprise Scribd logo
1  sur  9
Tutorial for Oracle10g Forms/Reports




Lesson 3

In this lesson, you will learn how to:

       Create Alerts (a modal window) on a push button that will function as a warning or a message
   to the users when they click the button.

      Create Procedures which are stored blocks of code which can be called from multiple objects
   saving the time taken for retyping codes

Creating an Alert

   1. Go to Alerts in the Object Navigator and double click on it.
   2. Double click on the newly created alert and name it DELETE_ALERT.
3. Now double click on the alert and you will immediately go to its Property Palette. In the
   properties:

   Change the title of the alert to Delete Alert, and Name to Delele_Alert.

   Type in the message as "Are you sure you want to Delete?"

   Select Stop as the Alert style

   You can add a third button to the alert or just keep the OK and Cancel
Make sure that Button1 is selected as the default button




4. To activate the alert, we will create a procedure which we will call from the delete button. To
   add a procedure, go to the Object Navigator and double click on Program Units. Immediately
   the window for the new Program unit will appear.
5. In the window for the new Program Unit, type in the name as Display_Delete-Alert. Make sure
   that procedure is selected as the type of Program Unit and click OK.




6. Once you click OK, you will be automatically taken to the PL/SQL Editor window.
7. In the PL/SQL Editor, type in the following code for activating the alert. You may have to
   delete a couple of lines from the Editor to avoid duplication. In this code, we will declare a
   number variable called return_alert. We will then set it to show the alert that we created
   earlier in this lesson called Delete_Alert. We will then write a simple if/then statement, such
   that if the user clicks on OK, which is alert button 1, then 10g Forms/Reports will perform the
   deletion and commit the changes. Otherwise, it will exit the alert window and help the users
   decide on their action. (See the following to get a view of the code as it should look in the
   PL/SQL editor. Do not forget to compile.)
8. We will now add a push button to the form and then add the above procedure to it, so that
   whenever the user clicks on delete, the alert will be shown. To do this, go the Layout Editor by
   double-clicking Canvas icon and add a push button to the form, go its properties, and change
   the label to Delete (use the steps used to create a push button in Lesson 2). Now go to its
   PL/SQL Editor by right clicking on the push button.
9. At the When-Button-Pressed trigger in the PL/SQL Editor, write the following code:

                               delete from student
                               where studid = :student.studid;
                               delete_record;
                               Display_Delete_Alert;

10.The last line of the code will call the previously created procedure Display_Delete_Alert and
   activate the alert whenever the user clicks on the delete button. The first two lines of code
   delete the record for any particular student ID.
11.Then click Run Form.
Lesson Summary

In this lesson you have learned how to:

      Create alerts on push buttons (delete) so that when the user clicks on the button the alert is
   shown as a warning

      Create procedures or stored blocks of code that can be called from any object
Next you will learn how to create reports. To do this, proceed to Lesson 4

Contenu connexe

En vedette (8)

Tutorials2
Tutorials2Tutorials2
Tutorials2
 
Empowering a new creative generation. Continuity Forum 2014
Empowering a new creative generation. Continuity Forum 2014 Empowering a new creative generation. Continuity Forum 2014
Empowering a new creative generation. Continuity Forum 2014
 
OpenDataHK Meetup 13 June 2013 What is Open Data?
OpenDataHK Meetup 13 June 2013 What is Open Data? OpenDataHK Meetup 13 June 2013 What is Open Data?
OpenDataHK Meetup 13 June 2013 What is Open Data?
 
Spanishisdifferent
SpanishisdifferentSpanishisdifferent
Spanishisdifferent
 
Smithie
SmithieSmithie
Smithie
 
Tuotorials
TuotorialsTuotorials
Tuotorials
 
Parents
ParentsParents
Parents
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
 

Similaire à Tutorials3

10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
paynetawnya
 
Gui builder
Gui builderGui builder
Gui builder
learnt
 
Diving into VS 2015 Day5
Diving into VS 2015 Day5Diving into VS 2015 Day5
Diving into VS 2015 Day5
Akhil Mittal
 
Lession 2 starting with mssqlserver
Lession 2 starting with mssqlserverLession 2 starting with mssqlserver
Lession 2 starting with mssqlserver
Đỗ Đức Hùng
 
Micro station v8 manual
Micro station v8 manualMicro station v8 manual
Micro station v8 manual
yuri30
 

Similaire à Tutorials3 (20)

10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
Android notifications. testing guideline
Android notifications. testing guidelineAndroid notifications. testing guideline
Android notifications. testing guideline
 
Logical Triggers.pdf
Logical Triggers.pdfLogical Triggers.pdf
Logical Triggers.pdf
 
Super components en Pascal
Super components en PascalSuper components en Pascal
Super components en Pascal
 
VBA Tips
VBA TipsVBA Tips
VBA Tips
 
Introduction
IntroductionIntroduction
Introduction
 
Gui builder
Gui builderGui builder
Gui builder
 
Newsletter Popup User Guide (Full version)
Newsletter Popup User Guide (Full version)Newsletter Popup User Guide (Full version)
Newsletter Popup User Guide (Full version)
 
MobileAppDev Handout#6
MobileAppDev Handout#6MobileAppDev Handout#6
MobileAppDev Handout#6
 
Diving into VS 2015 Day5
Diving into VS 2015 Day5Diving into VS 2015 Day5
Diving into VS 2015 Day5
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
 
I need some help answering these three questions listed below.1. A.pdf
I need some help answering these three questions listed below.1. A.pdfI need some help answering these three questions listed below.1. A.pdf
I need some help answering these three questions listed below.1. A.pdf
 
iOS Development (Part 2)
iOS Development (Part 2)iOS Development (Part 2)
iOS Development (Part 2)
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
 
Android action bar and notifications-chapter16
Android action bar and notifications-chapter16Android action bar and notifications-chapter16
Android action bar and notifications-chapter16
 
Lession 2 starting with mssqlserver
Lession 2 starting with mssqlserverLession 2 starting with mssqlserver
Lession 2 starting with mssqlserver
 
Micro station v8 manual
Micro station v8 manualMicro station v8 manual
Micro station v8 manual
 
Les14
Les14Les14
Les14
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Tutorials3

  • 1. Tutorial for Oracle10g Forms/Reports Lesson 3 In this lesson, you will learn how to: Create Alerts (a modal window) on a push button that will function as a warning or a message to the users when they click the button. Create Procedures which are stored blocks of code which can be called from multiple objects saving the time taken for retyping codes Creating an Alert 1. Go to Alerts in the Object Navigator and double click on it. 2. Double click on the newly created alert and name it DELETE_ALERT.
  • 2. 3. Now double click on the alert and you will immediately go to its Property Palette. In the properties: Change the title of the alert to Delete Alert, and Name to Delele_Alert. Type in the message as "Are you sure you want to Delete?" Select Stop as the Alert style You can add a third button to the alert or just keep the OK and Cancel
  • 3. Make sure that Button1 is selected as the default button 4. To activate the alert, we will create a procedure which we will call from the delete button. To add a procedure, go to the Object Navigator and double click on Program Units. Immediately the window for the new Program unit will appear.
  • 4. 5. In the window for the new Program Unit, type in the name as Display_Delete-Alert. Make sure that procedure is selected as the type of Program Unit and click OK. 6. Once you click OK, you will be automatically taken to the PL/SQL Editor window.
  • 5. 7. In the PL/SQL Editor, type in the following code for activating the alert. You may have to delete a couple of lines from the Editor to avoid duplication. In this code, we will declare a number variable called return_alert. We will then set it to show the alert that we created earlier in this lesson called Delete_Alert. We will then write a simple if/then statement, such that if the user clicks on OK, which is alert button 1, then 10g Forms/Reports will perform the deletion and commit the changes. Otherwise, it will exit the alert window and help the users decide on their action. (See the following to get a view of the code as it should look in the PL/SQL editor. Do not forget to compile.)
  • 6. 8. We will now add a push button to the form and then add the above procedure to it, so that whenever the user clicks on delete, the alert will be shown. To do this, go the Layout Editor by double-clicking Canvas icon and add a push button to the form, go its properties, and change the label to Delete (use the steps used to create a push button in Lesson 2). Now go to its PL/SQL Editor by right clicking on the push button.
  • 7. 9. At the When-Button-Pressed trigger in the PL/SQL Editor, write the following code: delete from student where studid = :student.studid; delete_record; Display_Delete_Alert; 10.The last line of the code will call the previously created procedure Display_Delete_Alert and activate the alert whenever the user clicks on the delete button. The first two lines of code delete the record for any particular student ID. 11.Then click Run Form.
  • 8. Lesson Summary In this lesson you have learned how to: Create alerts on push buttons (delete) so that when the user clicks on the button the alert is shown as a warning Create procedures or stored blocks of code that can be called from any object
  • 9. Next you will learn how to create reports. To do this, proceed to Lesson 4