lec15.365

lec15.365 - . . Fall 2007 . CPE/CSC 365: Introduction to...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
. . Fall 2007 CPE/CSC 365: Introduction to Database Systems Alexander Dekhtyar . . PL/SQL: Functions, Procedures, Packages User-defned Functions and Procedures in Anony- mous Blocks User-defned Functions and procedures are to be located in the declaration part oF PL/SQL’s anonymous blocks. Procedure declaration Procedures are callable blocks oF PL/SQL code which produce side-e±ects (e.g., changes in the database, printed output), but do not return any values. The syntax oF the procedure declaration is procedure <Name> [(<parameters>)] is [<declarations>] begin <statements>; [exception <statements>;] end; <Name> : name oF the procedure <parameters> : comma-separated list oF parameters (see below) <declarations> sequence oF type, variable and constant declarations The syntax For defning a parameter oF the procedure is <VarName> [in] [out] <type> in parameters: input parameters: must contain value when the proce- dure is called, do not change value in the procedure (analagous to pass- by-value). out parameters: output parameters: need not contain value when the procedure is called, should contain value when the procedure is over (analagous to pass-by-name/pass-by-reFerence). in out parameters: input-output parameters: must contain value when the procedure is called, the value may change during the procedure, new value is returned (analogous to pass-by-name/pass-by-reFerence).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/19/2008 for the course CSC 365 taught by Professor Dekhtyar during the Spring '08 term at Cal Poly.

Page1 / 5

lec15.365 - . . Fall 2007 . CPE/CSC 365: Introduction to...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online