Home arrow Oracle arrow Compile-Time Warnings for Oracle DB 10g

Compile-Time Warnings for Oracle DB 10g

In this fourth part of a nine-part series on managing PL/SQL code, you will learn about the compile-time warnings that were introduced in Oracle Database 10g Release 1. This article is excerpted from chapter 20 of the book Oracle PL/SQL Programming, Fourth Edition, written by Steven Feuerstein and Bill Pribyl (O'Reilly; ISBN: 0596009771). Copyright © 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

TABLE OF CONTENTS:
  1. Compile-Time Warnings for Oracle DB 10g
  2. PLW-05001: previous use of 'string' (at line string) conflicts with this use
  3. PLW-05004: identifier string is also declared in STANDARD or is a SQL built-in
  4. PLW-05005: function string returns without value at line string
By: O'Reilly Media
Rating: starstarstarstarstar / 2
November 08, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Warnings Available in Oracle Database 10g

In the following sections, letís take a look at most of the compile-time warnings that were introduced in Oracle Database 10g Release 1. I will offer an example of the type of code that will elicit the warning and also point out some interesting behavior (where present) in the way that Oracle has implemented compile-time warnings.

PLW-05000: mismatch in NOCOPY qualification between specification and body

The NOCOPY compiler hint tells Oracle that, if possible, you would like it to not make a copy of your IN OUT arguments. This can improve the performance of programs that pass large data structures, such as collections or CLOBs.

You need to include the NOCOPY hint in both the specification and the body of your program (relevant for packages and object types). If the hint is not present in both, Oracle will apply whatever is specified in the specification.

Here is an example of code that will generate this warning:

  /* File on web: plw5000.sql */
  CREATE OR REPLACE PACKAGE plw5000
  IS 
     
TYPE collection_t IS
       
TABLE OF VARCHAR2 (100);

     PROCEDURE proc (
       
collection_in IN OUT NOCOPY
          
collection_t);
  END plw5000;
  /
  CREATE OR REPLACE PACKAGE BODY plw5000
  IS
    
PROCEDURE proc (
       
collection_in IN OUT
          
collection_t)
        IS
        BEGIN
         
DBMS_OUTPUT.PUT_LINE ('Hello!');
       
END proc;
  END plw5000;
  /

Compile-time warnings will display as follows:

  SQL> SHOW ERRORS PACKAGE BODY plw5000
  Errors for PACKAGE BODY PLW5000:

  LINE/COL ERROR
  -------- --------------------------------
  3/20     PLW-05000: mismatch in NOCOPY
           qualification between
           specification and body

  3/20     PLW-07203: parameter
           'COLLECTION_IN' may benefit
           from use of the NOCOPY
           compiler hint



 
 
>>> More Oracle Articles          >>> More By O'Reilly Media
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: