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

PLW-05004: identifier string is also declared in STANDARD or is a SQL built-in - Oracle

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

Many PL/SQL developers are unaware of the STANDARD package, and its implications for their PL/SQL code. For example, it is common to find programmers who assume that names like INTEGER and TO_CHAR are reserved words in the PL/SQL language. That is not the case. They are, respectively, a datatype and a function declared in the STANDARD package.

STANDARD is one of the two default packages of PL/SQL (the other is DBMS_STANDARD). Because STANDARD is a default package, you do not need to qualify references to datatypes like INTEGER, NUMBER, PLS_INTEGER, etc., with “STANDARD”—but you could, if you so desired.

PLW-5004 notifies you if you happen to have declared an identifier with the same name as an element in STANDARD (or a SQL built-in; most built-ins—but not all—are declared in STANDARD).

Consider this procedure definition:

  1 CREATE OR REPLACE PROCEDURE plw5004
 2 IS
 3    INTEGER   NUMBER;
 4
 5    PROCEDURE TO_CHAR
 6    IS
 7    BEGIN
 8       INTEGER := 10;
 9    END TO_CHAR;
 10 BEGIN
 11    TO_CHAR;
 12 * END plw5004;

Compile-time warnings for this procedure will display as follows:

  LINE/COL ERROR 
  -------- ---------------------------------
  3/4      PLW-05004: identifier INTEGER is
           also declared in STANDARD or is a
           SQL builtin
  5/14     PLW-05004: identifier TO_CHAR is
           also declared in STANDARD or is a
           SQL builtin

You should avoid reusing the names of elements defined in the STANDARD package unless you have a very specific reason to do so.



 
 
>>> 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: