views:

41

answers:

1

If I wanted to replace the * with a column name, what would it be?

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  A: 

COLUMN_VALUE is the name of the column

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.
Justin Cave
Damn you rock. I'm starting the Justin Cave fan club