Home » SQL & PL/SQL » SQL & PL/SQL » nested tables
nested tables [message #289870] Wed, 26 December 2007 06:00 Go to next message
piscean_n
Messages: 36
Registered: December 2007
Member
In nested tables if a column is of datatype TYPE

then using desc command we get something like this:

suppose messages is a nested table tab_ty_messages.
in this table it has 2 columns message_id,message_text

so using desc command m getting tab_ty_messages instead of this i want message_id,message_text

how can i get.
Re: nested tables [message #289872 is a reply to message #289870] Wed, 26 December 2007 06:04 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member

SET DESCRIBE DEPTH 5 --(it can be any number).


regards,
Re: nested tables [message #289873 is a reply to message #289872] Wed, 26 December 2007 06:18 Go to previous messageGo to next message
piscean_n
Messages: 36
Registered: December 2007
Member
i gave set describe depth 30 also
but still it is not working.
Re: nested tables [message #289878 is a reply to message #289873] Wed, 26 December 2007 06:31 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
can you post what you have done .
SQL> create type tab_ty_message as object
  2  (
  3  messge_id number,
  4  message_txt varchar2(30)
  5  )
  6  /

Type created.

SQL> desc tab_ty_message
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 MESSGE_ID                                          NUMBER
 MESSAGE_TXT                                        VARCHAR2(30)

SQL> create or replace type message_tab as table of tab_ty_message
  2  /

Type created.

SQL> create table test_message
  2  (
  3  msg message_tab
  4  )
  5  nested table msg store as msg_tab
  6  /

Table created.

SQL> desc test_message
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 MSG                                                MESSAGE_TAB

SQL> set desc depth 10
SQL> desc test_message
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 MSG                                                MESSAGE_TAB
   MESSGE_ID                                        NUMBER
   MESSAGE_TXT                                      VARCHAR2(30)

SQL> desc message_tab
 message_tab TABLE OF TAB_TY_MESSAGE
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 MESSGE_ID                                          NUMBER
 MESSAGE_TXT                                        VARCHAR2(30)

SQL>


regards,
Re: nested tables [message #289881 is a reply to message #289878] Wed, 26 December 2007 06:47 Go to previous message
piscean_n
Messages: 36
Registered: December 2007
Member
ok.thanks
Previous Topic: How to find the no of records selected by a curcor before processing the rows?
Next Topic: Copy Table
Goto Forum:
  


Current Time: Fri Dec 09 08:03:36 CST 2016

Total time taken to generate the page: 0.06105 seconds