Re: Is this a bug...

From: Adam Hapworth <hap_at_mikomi.org>
Date: 12 Sep 2002 18:19:39 -0700
Message-ID: <a6cb04db.0209121719.2bd3efac_at_posting.google.com>


rajXesh_at_hotmail.com (RK) wrote in message news:<548b9514.0209120544.539306df_at_posting.google.com>...
> Is this a bug?
>
> I can define a package as
>
>
> CREATE OR REPLACE PACKAGE testpkg AS
>
> TYPE foo IS REF CURSOR;
> foo NUMBER;
> foo VARCHAR2 (5);
> foo DATE;
> foo CONSTANT number := 4;
> foo CONSTANT varchar2(6) := 'QWERTY';
> foo CONSTANT date := SYSDATE;
>
> END testpkg;

Actually it is doing exactly what you told it to do. Basically you are redefining the variable foo mutiple times. The last time you define it is what it will be in your program.

try doing this after you compile you package

SQL> exec dbms_output.put_line(testpkg.foo) -- since foo is a CONSTANT

     12-SEP-02
SQL>
What happened is normal and not a bug just "sloppy" coding practices.

Adam Received on Fri Sep 13 2002 - 03:19:39 CEST

Original text of this message