powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Oracle [игнор отключен] [закрыт для гостей] / 12c select .. from table ( package collection)
10 сообщений из 10, страница 1 из 1
12c select .. from table ( package collection)
    #38762448
12с
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Господа, подскажите пожалуйста ссылку на документацию.
Не могу найти, где описана table function для PLSQL - select * from table (collection).
А то я вижу что есть в 12-ке возможность использовать nested table объявленный в пакете, а не как раньше object - type на уровне базы, но в упор не могу найти это в документации.
Или я путаю что-то и всегда можно было выбирать в пакете из пакетной же коллекции оператором table?
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762474
12сИли я путаю что-то и всегда можно было выбирать в пакете из пакетной же коллекции оператором table?
Можно было.
Но не всегда.
И при этом все равно неявно создается тип.
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762475
Фотография -2-
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
New Features Guide 2.1.4.12 PL/SQL-Specific Data Types Allowed Across the PL/SQL-to-SQL Interface

Through Oracle Database 11g Release 2 (11.2), when PL/SQL invoked SQL, only values with data types supported by SQL could be bound. This restriction applied even when the called SQL was a PL/SQL anonymous block. This restriction is removed in Oracle Database 12c Release 1 (12.1). For example, a PL/SQL subprogram with a formal parameter whose data type is BOOLEAN can now be invoked dynamically using an anonymous block.

Other restrictions are also removed. The table operator can now be used in a PL/SQL program on a collection whose data type is declared in PL/SQL. This also allows the data type to be a PL/SQL associative array. (In prior releases, the collection's data type had to be declared at the schema level.)

The removal of these restrictions increases the power of expression and the usefulness of PL/SQL. In particular, the extended flexibility of the table operator allows code written to run other vendors' stored procedure languages to be easily migrated to PL/SQL.
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762484
stax..
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
уувуукукуку12сИли я путаю что-то и всегда можно было выбирать в пакете из пакетной же коллекции оператором table?
Можно было.
Но не всегда.
И при этом все равно неявно создается тип.
в 12-ке не создается?

.....
stax
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762489
stax..уувуукукукупропущено...

Можно было.
Но не всегда.
И при этом все равно неявно создается тип.
в 12-ке не создается?

.....
stax
Наверное создается или может какой механизм обходной придумали )
С 12 не встречался.
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762491
12c
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
12c
Гость
-2-,

Точно, спасибо большое, читал как-то new featches и пропустил. А сейчас по поиску не смог найти . Плохо значит искал.
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762539
stax..
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
-2-New Features Guide 2.1.4.12 PL/SQL-Specific Data Types Allowed Across the PL/SQL-to-SQL Interface

Through Oracle Database 11g Release 2 (11.2), when PL/SQL invoked SQL, only values with data types supported by SQL could be bound. This restriction applied even when the called SQL was a PL/SQL anonymous block. This restriction is removed in Oracle Database 12c Release 1 (12.1). For example, a PL/SQL subprogram with a formal parameter whose data type is BOOLEAN can now be invoked dynamically using an anonymous block.

Other restrictions are also removed. The table operator can now be used in a PL/SQL program on a collection whose data type is declared in PL/SQL. This also allows the data type to be a PL/SQL associative array. (In prior releases, the collection's data type had to be declared at the schema level.)

The removal of these restrictions increases the power of expression and the usefulness of PL/SQL. In particular, the extended flexibility of the table operator allows code written to run other vendors' stored procedure languages to be easily migrated to PL/SQL.
в 12-ке отработает?
Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
declare
 type stax_NUM_TABLE IS TABLE OF NUMBER;
 tt stax_NUM_TABLE :=stax_NUM_TABLE(1.2);
-- ta ANE_NUM_TABLE :=ANE_NUM_TABLE(1,2);
begin
 for r in (select * from table(tt) ) loop
  dbms_output.put_line(r.column_value);
 end loop;
end;
/


......
stax
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762572
ora601
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
12c-2-,

Точно, спасибо большое, читал как-то new featches и пропустил. А сейчас по поиску не смог найти . Плохо значит искал.

new fetches maybe ? :)
...
Рейтинг: 0 / 0
12c select .. from table ( package collection)
    #38762825
Фотография Elic
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
stax..в 12-ке отработает?
Код: plsql
1.
declare

RTFM More PL/SQL-Only Data Types Can Cross PL/SQL-to-SQL Interface (FAQ) :The PL/SQL-only data type must be either predefined (like BOOLEAN in Example 7-2) or declared in a package specification (like the record in Example 7-3).
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
12c select .. from table ( package collection)
    #39381277
arlx
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
а так отработает.
Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
create or replace package p_test is
  type t_num is table of t_table%rowtype;
  function fn_nsttbl return number;
end p_test;
/
create or replace package body p_test is

  function fn_nsttbl return number is
    l t_num;
    i number;
  begin
    select * bulk collect into l from t_table;
    select count(1) into i from table(l);
    dbms_output.put_line(i);
    return i;
  end;
end p_test;
/
select p_test.fn_nsttbl from dual;
...
Рейтинг: 0 / 0
10 сообщений из 10, страница 1 из 1
Форумы / Oracle [игнор отключен] [закрыт для гостей] / 12c select .. from table ( package collection)
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]