Показать сообщение отдельно
  #2  
Старый 06.10.2010, 14:26
Аватар для NumLock
NumLock NumLock вне форума
Let Me Show You
 
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
По умолчанию

Код:
CREATE OR REPLACE
type courselist as table of varchar2(10)
/

CREATE OR REPLACE
type trec as object (
  fld varchar2(10),
  courses courselist
);
/

CREATE OR REPLACE
type ttab as table of trec;
/

CREATE OR REPLACE
package dataset
is

  function getdataset(arows number) return ttab;

end;
/

CREATE OR REPLACE
package body dataset
is

  function getdataset(arows number) return ttab
  as
    t ttab;
    r trec;
    i number;
  begin
    t:=ttab();
    for i in 1..arows loop
      r:=trec(1, 2, 3, 4, 5, 6, 7, 8);
      t.extend;
      t(t.last):=r;
      r:=trec('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h');
      t.extend;
      t(t.last):=r;
      r:=trec('привет', '', 'от', '', 'GR@F', '', '', '');
      t.extend;
      t(t.last):=r;
      r:=trec('а суть', '', '', '', '', '', '', '');
      t.extend;
      t(t.last):=r;
      r:=trec('', '', 'этой', 'басни', 'в', 'том', ',', '');
      t.extend;
      t(t.last):=r;
      r:=trec('', '', '', '', '', '', 'что', 'можно');
      t.extend;
      t(t.last):=r;
      r:=trec('ляпать', 'свои', 'наборы', 'данных', '', '', '', '');
      t.extend;
      t(t.last):=r;
      r:=trec('', '(', 'как', 'этот', ')', '', '', '');
      t.extend;
      t(t.last):=r;
    end loop;
    return t;
  end;

end;
/

/*
select * from table(cast(dataset.getdataset(1) as ttab))
*/
__________________
Пишу программы за еду.
__________________
Ответить с цитированием