Get the PL/SQL Programming book by Oracle Press.
Thats where I got the definitions below from.

It also comes with a CD containing scripts which will populate
database tables so you can try the examples in the book.

Go nuts!

-----Original Message-----
Sent: Thursday, June 28, 2001 5:17 PM
To: Multiple recipients of list ORACLE-L


I am a bit confused as to when to use the following.  I 
cannot seem to find any definitive rules.

- function
"Functions are named PL/SQL blocks that return a value and
can be called with arguments. They can be used as part of an
expression. They are legal in procedural statements, and certain
functions can be used in SQL statements in PL/SQL 2.1 and higher.
Functions can be stored in the database with the CREATE [OR REPLACE]
FUNCTION command, or they can be located in the declarative section
of another block."


- cursor
"Cursors are used to control the processing for queries that return
more than one row. A cursor is declared using the CURSOR..IS syntax,
then processed with OPEN, FETCH, and CLOSE. Cursor attributes are used to
determine the current status of a cursor, with information about how many
rows the cursor has returned, whether the cursor is open, and whether the
last fetch was successful."


- procedure
"Procedures can be stored in the database with the CREATE OR REPLACE
PROCEDURE statement, or they can be declared in the declarative secion of a
block. A procedure is a named block that can be called with parameters. The
parameters can either accept a value from the calling environment (IN),
return a value to the calling environment (OUT), or both (IN OUT)."


- package
"Packages are defined as two separate data dictionary objects--the package
header (or specification) and the package body. The header is created with
the CREATE OR REPLACE PACKAGE command, the body with the CREATE OR REPLACE
PACKAGE BODY command. Packages must be stored in the database; they cannot
be placed in the declarative section like procedures or functions. Packages
themselves can contain procedures, functions, variables, types, cursors, and
exceptions. Items declared in the package header will be visible outside the
package, while items defined in only the package body will be private to the
package. Packages also break the dependency chain because the package body
can be recompiled without affecting the package specification."

If someone can point me to a white paper, or whatever, 
that defines the rules for their usage I would be most 
thankful.

Thanks,
Ken Janusz, CPIM
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


* * * * * Freedom of Information Act Notice * * * * * 
The information in this email is subject to the record protection mandated
by 5 United States Code 552(b)(4) and relevant judicial opinions. 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Sherman, Edward
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to