如果我将Number的集合转换为表格,那么列的名称是什么? 10gR2中

时间:2008-11-06 22:21:12

标签: sql oracle collections

如果我想用列名替换*,它会是什么?

create type mytable$t as table of number;
/

declare 

mytmou  mytable$t := myTable$T();

cnt pls_integer ;

begin

    mytmou := myTable$T(1,2,3,4,5,6);

    SELECT count(*) into cnt From Table (mytmou);

    dbms_output.put_line(cnt);

end;

6

1 个答案:

答案 0 :(得分:2)

COLUMN_VALUE是列的名称

SQL> ed
Wrote file afiedt.buf

  1  declare
  2    mytmou  mytable$t := myTable$T();
  3    cnt pls_integer ;
  4  begin
  5      mytmou := myTable$T(1,2,3,4,5,6);
  6      SELECT count(column_value) into cnt From Table (mytmou);
  7      dbms_output.put_line(cnt);
  8* end;
SQL> /
6

PL/SQL procedure successfully completed.