Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 851385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:25:19+00:00 2026-05-15T07:25:19+00:00

i have a type as follows: CREATE OR REPLACE TYPE tbusiness_inter_item_bag AS OBJECT (

  • 0

i have a type as follows:

CREATE OR REPLACE TYPE tbusiness_inter_item_bag AS OBJECT (
   item_id              NUMBER,
   system_event_cd      VARCHAR2 (20),
   CONSTRUCTOR FUNCTION tbusiness_inter_item_bag RETURN SELF AS RESULT
);
CREATE OR REPLACE TYPE BODY tbusiness_inter_item_bag
AS
   CONSTRUCTOR FUNCTION tbusiness_inter_item_bag RETURN SELF AS RESULT
   AS
   BEGIN
      RETURN;
   END;
END;

when i execute the following script, i got a “Reference to uninitialized composite” error, which is imho quite suitable.

DECLARE
   item   tbusiness_inter_item_bag;
BEGIN
   item.system_event_cd := 'ABC';
END;

This also raises the same error:

item.item_id := 3;

But if i change my object type into:

CREATE OR REPLACE TYPE tbusiness_inter_item_bag AS OBJECT (
   item_id              NUMBER(1),
   system_event_cd      VARCHAR2 (20),
   CONSTRUCTOR FUNCTION tbusiness_inter_item_bag RETURN SELF AS RESULT
);

then the last statement raises no more error (where my “item” is still uninitialized):

item.item_id := 3;

Shouldn’t i get the same ORA-06530 error?

ps: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:25:19+00:00Added an answer on May 15, 2026 at 7:25 am

    I reproduced the same behaviour in Oracle 11gR1. I would agree with you, this seems like a bug to me too, albeit a trivial one.

    SQL> CREATE OR REPLACE TYPE tbusiness_inter_item_bag AS OBJECT (
      2     item_id              NUMBER(1),
      3     system_event_cd      VARCHAR2 (20),
      4     CONSTRUCTOR FUNCTION tbusiness_inter_item_bag RETURN SELF AS RESULT
      5  );
      6  /
    
    Type created.
    
    SQL> DECLARE
      2     item   tbusiness_inter_item_bag;
      3  BEGIN
      4     item.item_id := 1;
      5  END;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Note that this still fails:

    SQL> DECLARE
      2     item   tbusiness_inter_item_bag;
      3  BEGIN
      4     item.item_id := 1;
      5     item.system_event_cd := 'ABC';
      6  END;
      7  /
    DECLARE
    *
    ERROR at line 1:
    ORA-06530: Reference to uninitialized composite
    ORA-06512: at line 5
    
    SQL>
    

    Obviously, the correct practice is always initialize objects before referencing them.

    SQL> DECLARE
      2     item   tbusiness_inter_item_bag := tbusiness_inter_item_bag();
      3  BEGIN
      4     item.system_event_cd  := 'ABC';
      5  END;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create a folder as follows. function create(){ if ($this->input->post('name')){ ... ... $folder =
I have a type ahead text field, and when the user hits Enter I
I have my type x of type varchar(50). How can I alter it to
I have a type which I consider use it as struct. It represents single
I have 2 time values which have the type datetime.time . I want to
If I have a type defined as a set of an enumerated type, it's
When I'm on master, I only have to type 'git push' to push commits
I have a simple type that explicitly implemets an Interface. public interface IMessageHeader {
I have a reference-type variable that is readonly , because the reference never change,
If I have variable of type IEnumerable<List<string>> is there a LINQ statement or lambda

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.