iSelfSchooling.com - Copyright © 1999-2007 iSelfSchooling.com  References  Job Openings  |  Secure Login
    Home  | Search more...  |  FREE Online VIDEO Oracle Training  |  Gift Store  |  Bookstore

   Unlimited access!   

    Oracle  Syntax  | Suggestions Your Contribution  |  FREE Legal Forms

 

Email2aFriend Homepage us! |  Bookmark   -  Copyright & User Agreement

Products/Services

 Vision/Mission

 Community Sharing

 Services

  Products

 Biography

 Contact Us

 FAQ

 Current News

 Website Traffic

 Bookstore

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

Topics:  Hands-On 03 – Creating PL/SQL Stored Procedure

In this Hands-On, you write a PL/SQL stored procedure to remove a record from the department table (dept).  You use one input parameter to pass the department number (deptno); and use one another output parameter to check the status of the delete transaction.

You will:

    1- Write a PL/SQL procedure to remove a record using Procedure Builder.

    2- Use input and output parameters.

    3- Run the stored procedure.

    4- Test the stored procedure.

    5- Save the procedure.

 

More Resources by Google:

Manuscript

 

Write a procedure to remove a department record.

=

Select "program units" and click “create”.

=

Type the procedure name (remove department); and click “OK.”

=

 

Define one input parameter for the department number; and an output parameter as a status parameter. You will use this parameter to test the status of the deleted transaction.

=

In the PL/SQL body, delete the department record where it's department number matches with the input department number parameter.

=

Save the deleted transaction.

=

Assign "OK" to the status output parameter for a successful deleted transaction.

=

Include the exceptions.

=

Compile the procedure.

Successfully compiled.  Then close the window.

=

Save the procedure in the database server.

Drag it to the database server.

=

Go to the PL/SQL interpreter.

Here, you can write an anonymous block to run the procedure to test it.

 

Or, you can open the previous “test my proc” procedure; and modify it.

This is an easier way.

Do any necessary changes.

 

Change the called procedure and its parameter.

Remove the department number 50.

 

Use the "text_io" package to output the status of the deleted transaction.

=

Compile the procedure; and close the window.

=

Run the “test my proc” calling procedure.

“OK” means: the deleted transaction was successful.

=

Query the department table again.

There should be no "Finance" department.

Now, you should practice this over and over, until you become a master at it.

Good Luck!

 

 
 
Google
 
Web web site