Oracle Database 10g PL/SQL Programming

3y ago
127 Views
21 Downloads
7.73 MB
895 Pages
Last View : 1m ago
Last Download : 2m ago
Upload by : Abram Andresen
Transcription

Oracle Database 10gPL/SQL Programming

This page intentionally left blank

Oracle Database 10gPL/SQL ProgrammingScott UrmanRon HardmanMichael McLaughlinMcGraw-Hill/OsborneNew York Chicago San FranciscoLisbon London Madrid Mexico City MilanNew Delhi San Juan Seoul Singapore SydneyToronto

Copyright 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Manufactured in the United Statesof America. Except as permitted under the United States Copyright Act of 1976, no part of this publication maybe reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without theprior written permission of the publisher.0-07-150228-9The material in this eBook also appears in the print version of this title: 0-07-223066-5.All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner,with no intention of infringement of the trademark. Where such designations appear in this book, they have beenprinted with initial caps.McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or foruse incorporate training programs. For more information, please contact George Hoare, Special Sales, atgeorge hoare@mcgraw-hill.com or (212) 904-4069.TERMS OF USEThis is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve allrights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Actof 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverseengineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish orsublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your ownnoncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work maybe terminated if you fail to comply with these terms.THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES ORWARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BEOBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSEDTHROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will beuninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hillhas no responsibility for the content of any information accessed through the work. Under no circumstances shallMcGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similardamages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether suchclaim or cause arises in contract, tort or otherwise.DOI: 10.1036/0072230665

About the AuthorsScott Urman is a Principal Member of Technical Staff in the Diagnostics and DefectResolution (DDR) team in Oracle’s Server Technology division. He currently focuseson the internals of Oracle Text and Oracle Ultrasearch, and has worked with JSP,JDBC, PL/SQL, and OCI. Prior to joining DDR, he was a Senior Analyst in theLanguages division of Oracle Worldwide Technical Support, focusing on all ofOracle’s language tools. He has been with Oracle since 1989. He is also the bestselling author of Oracle8i Advanced PL/SQL Programming, Oracle8 PL/SQLProgramming, and Oracle9i PL/SQL Programming.Ron Hardman, OCP, is a Senior Technical Specialist with Oracle WorldwideTechnical Support. Prior to joining Oracle Corporation, he was an Oracle DatabaseDeveloper and Consultant. He is a frequent presenter on the topics of Oracle Textand Ultrasearch at Oracle User Group conferences, teaches classes on SQL and PL/SQL, and has published articles with Oracle Magazine and other online magazineson subjects related to information retrieval.Michael McLaughlin, D. CS., is the Senior Application Upgrade Manager forOracle Applications Release Engineering. He is currently working on the upgradearchitecture for the next release of Oracle Applications. He has worked with PL/SQLsince its first version in Oracle 6, and has authored customer support notes oncustomizing Oracle Applications with Pro*C and PL/SQL. He has taught computerscience and information technology at Regis University and Colorado TechnicalUniversity, including courses in database development, SQL, PL/SQL, and Java.About the Technical EditorCheryl Riniker is a Senior Technical Specialist with Oracle Worldwide Support inOracle’s Bug Diagnosis and Escalation division. She currently works with OracleApplications’ Financials Suite of products. She has used PL/SQL in developmentprojects since 1997, and received her DBA OCP in 2001. She graduated magnacum laude with an M.A. in English/ESL from Utah State University.Copyright 2004 by The McGraw-Hill Companies, Inc. Click here for terms of use.

This page intentionally left blank

This book is dedicated to ourdaughter Almarah Rose Urman,born May 1st, 2004.—Scott UrmanTo my wife Susan, you inspire me.Thank you for your patience and encouragement.To my daughter Jessica, and son Joshua, thank you foryour hugs and kisses. They never ran out.To my parents, thank you for your example.—Ron HardmanTo my wife Lisa, who is my constant,and our children Sarah, Joseph, Elise,Ian, Ariel, Callie, Nathan, and Spencer.Thank you for your inspiration, patience,and sacrifice that made my effortson this book possible.—Michael McLaughlin

This page intentionally left blank

Contents at a GlancePART IIntroduction1 Introduction to PL/SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Using SQL*Plus and JDeveloper3.233 PL/SQL Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .454 Using SQL with PL/SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1175 Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1816 Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2137 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3038 Creating Procedures, Functions, and Packages . . . . . . . . . . . . . . . . . . . . . . 3359 Using Procedures, Functions, and Packages. . . . . . . . . . . . . . . . . . . . . . . . 38110 Database Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443PART IIAdvanced PL/SQL Features11 Intersession Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49912 External Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54313 Dynamic SQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58314 Introduction to Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63515 Objects in the Database16 Large Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71117 Scheduling Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767ix

xOracle Database 10g PL/SQL ProgrammingPART IIIAppendixesA PL/SQL Reserved Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791B Guide to Supplied Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839

For more information about this title, click hereContentsPART IIntroduction1 Introduction to PL/SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Introduction to Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . . .Note to Beginning Programmers . . . . . . . . . . . . . . . . . . . . . . . . . . . .PL/What? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Structured Query Language (SQL) . . . . . . . . . . . . . . . . . . . . . . . . . . .Relational Database Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . .PL/SQL vs. SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .PL/SQL vs. Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .PL/SQL History and Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Language Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Anonymous Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .PL/SQL Statement Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Interpreted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Native Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Getting the Most from This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .345667911121515161616161717171818181819202021xi

xiiOracle Database 10g PL/SQL Programming2 Using SQL*Plus and JDeveloper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .SQL*Plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Connecting to the Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Testing the Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using SQL*Plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Changing SQL*Plus Session Settings . . . . . . . . . . . . . . . . . . . . . . . . .Running a Script from a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Output to the Screen Using SQL*Plus and PL/SQL . . . . . . . . . . . . . .JDeveloper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Installing JDeveloper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Working with PL/SQL in JDeveloper . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2324252628313133343436433 PL/SQL Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The PL/SQL Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Basic Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Anonymous Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Named Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Nested Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Language Rules and Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Lexical Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .PL/SQL Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Character/String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .NUMBER Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Date/Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Composite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .LOB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .%TYPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .%ROWTYPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Variable Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Bind Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Hiding Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Assignment Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Concatenation Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Controlling Program Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Conditional Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Circular Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Sequential Navigation using GOTO . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7100101102102103110113115

Contents4 Using SQL with PL/SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Transaction Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Transactions and Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Autonomous Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Set Transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Retrieving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .SQL SELECT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Pattern Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Information Retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .How Cursors Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Explicit Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Implicit Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Cursor Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Cursor Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Open Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DML and DDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Pre-Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Manipulating Data with DML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Introduction to Dynamic SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using ROWID and ROWNUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ROWID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ROWNUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Built-in SQL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Character Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Numeric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Date Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Conversion Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Error Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Other Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581591601631641651651691721721721741751761781795 Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Introducing Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .What Is a Record? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Working with Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Defining Record Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Defining and Using Record Types as Formal Parameters . . . . . . . . . .Defining and Using Object Types as Parameters . . . . . . . . . . . . . . . .Returning Record Types from Functions . . . . . . . . . . . . . . . . . . . . . .Defining and Using Record Types as Return Values . . . . . . . . . . . . .Defining and Using Object Types as Return Values . . . . . . . . . . . . .Verifying Work with Record Types . . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181182182182183198202205205207210212xiii

xivOracle Database 10g PL/SQL Programming6 Collections . . . . . .

Oracle’s language tools. He has been with Oracle since 1989. He is also the best-selling author of Oracle8i Advanced PL/SQL Programming, Oracle8 PL/SQL Programming, and Oracle9i PL/SQL Programming. Ron Hardman, OCP, is a Senior Technical Specialist with Oracle Worldwide Technical Support. Prior to joining Oracle Corporation, he was an Oracle .

Related Documents:

1. Oracle Database 10g SQL (Osborne ORACLE Press Series)by Jason price, McGrawHill, 0-07-222981-0. 2. Oracle Database 10g PL/SQL Programming by Scott Urman , Ron HARDMAN, MichaleMc Laughlin, Oracle Press, TMH, ISBN-0-07- 059779-0. 3. Oracle Database 10g The Complete Reference By Kevin Loney, Bob Bryla Oracle Press

viii Related Documentation The platform-specific documentation for Oracle Database 10g products includes the following manuals: Oracle Database - Oracle Database Release Notes for Linux Itanium - Oracle Database Installation Guide for Linux Itanium - Oracle Database Quick Installation Guide for Linux Itanium - Oracle Database Oracle Clusterware and Oracle Real Application Clusters

Oracle is a registered trademark and Designer/2000, Developer/2000, Oracle7, Oracle8, Oracle Application Object Library, Oracle Applications, Oracle Alert, Oracle Financials, Oracle Workflow, SQL*Forms, SQL*Plus, SQL*Report, Oracle Data Browser, Oracle Forms, Oracle General Ledger, Oracle Human Resources, Oracle Manufacturing, Oracle Reports,

Oracle Database 11g Expert Oracle Database Architecture: Oracle Database 9i, 10g, and 11g Programming Techniques and Solutions, Second Edition Dear Reader, Expert Oracle Database Architecture, 2nd Edition is a book that explores and defines the Oracle d

In-database analytical SQL with Oracle Database 12c This section outlines the high level processing concepts behind analytical SQL. Processing concepts behind analytical SQL Oracle’s in-database analytical SQL – first introduced in Oracle Database 8i Release

Welcome to SQL for Oracle NoSQL Database. This language provides a SQL-like interface to Oracle NoSQL Database. The SQL for Oracle NoSQL Database data model supports flat relational data, hierarchical typed (schema-full) data, and schema-less JSON data. SQL for Oracle NoSQL Database is designed to handle all such data seamlessly without any

Oracle is a registered trademark and Developer/2000, Oracle8, Oracle Application Object Library, Oracle Alert, Oracle Financials, Oracle Quality, Oracle Workflow, Oracle Work in Process, SQL*Forms, SQL*Plus, SQL*AMX, SQL*Report, and SQL*ReportWriter are

The facts and extensive procedural history of Albert Woodfox’s case have been recounted time and again, but they bear repeatingsince they factored into theunconditional writ granted by the district court On April 17, 1972, . Correctional Officer Brent Millerof the Louisiana State Penitentiary in , Angola, Louisiana, was found murderedin the prison dormitory , havingbeen stabbed 32 times. The .