Home » SQL & PL/SQL » SQL & PL/SQL » What is the purpose of this collection type ??
What is the purpose of this collection type ?? [message #227736] Thu, 29 March 2007 04:04 Go to next message
sireeshraju
Messages: 32
Registered: October 2005
Member

Hi

CREATE OR REPLACE TYPE "MF_TST_TAB"


Yes,We create a collection Type like this without mentioning whether it is a Varray or a Table type. My question is in which scenario we can use this type of collection.



Sireesh
Re: What is the purpose of this collection type ?? [message #227870 is a reply to message #227736] Thu, 29 March 2007 22:38 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
I don't know the answer, but at a guess it is probably a way to create a self-referencing object type. The next step would be to create the type, including a ref to itself.

Like I said though, I'm just guessing.

Ross Leishman
Re: What is the purpose of this collection type ?? [message #227874 is a reply to message #227736] Thu, 29 March 2007 23:07 Go to previous messageGo to next message
srinivasocp
Messages: 91
Registered: December 2005
Location: INDIA
Member
I think this is a rather tough question which needs to be answered by some experts with some example to make this concept more clear.

Best regards
Srini

[Updated on: Thu, 29 March 2007 23:14]

Report message to a moderator

Re: What is the purpose of this collection type ?? [message #228035 is a reply to message #227874] Fri, 30 March 2007 16:35 Go to previous messageGo to next message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
SQL> CREATE OR REPLACE TYPE "MF_TST_TAB";
  2  /

Type created.

SQL> desc MF_TST_TAB
 MF_TST_TAB is an incomplete TYPE


CREATE TYPE describes incomplete types:
Quote:
An incomplete type is a type created by a forward type definition. It is called "incomplete" because it has a name but no attributes or methods. It can be referenced by other types, and so can be used to define types that refer to each other. However, you must fully specify the type before you can use it to create a table or an object column or a column of a nested table type.


SQL> DECLARE
  2      o MF_TST_TAB;
  3  BEGIN
  4      NULL;
  5  END;
  6  /
    o MF_TST_TAB;
      *
ERROR at line 2:
ORA-06550: line 2, column 7:
PLS-00311: the declaration of "MF_TST_TAB" is incomplete or malformed
ORA-06550: line 2, column 7:
PL/SQL: Item ignored

To be honest I can't see any use for it.

btw it's not a collection type.
Re: What is the purpose of this collection type ?? [message #228041 is a reply to message #227736] Fri, 30 March 2007 21:43 Go to previous message
srinivasocp
Messages: 91
Registered: December 2005
Location: INDIA
Member
Thanks a lot William,it's clear.
Previous Topic: number(currency) format
Next Topic: dimensions
Goto Forum:
  


Current Time: Fri Dec 09 01:50:21 CST 2016

Total time taken to generate the page: 0.14471 seconds