DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How can I select the data from a table type

  1. #1
    Join Date
    Sep 2001
    Posts
    99
    I defined a type like follow:
    type utility_array is table of varchar2(200) index by binary_integer;

    nmt utility_array;
    if the data like follows:
    nmt(0) = 1
    nmt(1) = 2
    nmt(2) = 3
    How can I select the data from the nmt?
    If I use the statement like follow:
    select count(*) from nmt;
    an error was occured.
    I want to do this
    insert into tablename select * from nmt;
    so I can insert more rows at the same sql statement.
    How can I do ?
    Please help.
    thanks
    ocean

  2. #2
    Join Date
    May 2001
    Location
    San Francisco, California
    Posts
    511
    An index-by table is not a database table. Its structure is not similar to a table object. You can loop through with an index, or you can insert multiple values by referring the table elements by index notation.

    insert into {table} values (nmt(0), nmt(1)....) etc.,

    Note that datatypes should match when you insert into a database table.
    Remember the Golden Rule - He who has the gold makes the rules!
    ===================
    Kris109
    Ph.D., OCP 8i, 9i, 10g, 11g DBA

Posting Permissions

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


Click Here to Expand Forum to Full Width