Results 1 to 5 of 5

Thread: create varray

  1. #1
    Join Date
    Aug 2007
    Posts
    64

    Lightbulb Unanswered: create varray

    I am trying to execute the below statement in Oracle . But its throwing a warning .
    here 'tab_a' is a table with only one column 'i' .(create table tab_a(i int))

    create type va IS varray(123) of tab_a.i%type
    Please tell me whats wrong with this

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Datatype must be Oracle Database built-in datatype or user-defined type; 'tab_a.i%type' is not valid. Check Oracle documentation page which will show you how to Create a Type.

  3. #3
    Join Date
    Aug 2007
    Posts
    64
    Thanks for ur reply ,

    What modifications i need to do for the above code . By default tab_a.i is a TYPE which is tab_a.i column . So we can directly specify this type .

    Any suggestions please

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    No, 'TAB_A' is table, 'I' is column in this table and its data type is ... what? NUMBER? So you'd
    Code:
    SQL> create type va is varray (123) of NUMBER;
      2  /
    
    Type created.
    
    SQL>

  5. #5
    Join Date
    Aug 2007
    Posts
    64
    Thanks a lot, i got it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •