PL / SQL Package Table

I need to maintain state in a PL / SQL application. During the session, you need to hold a small table.

As I understand it, this is done using a package variable, but I don't know how to create a table as a package variable.

Does anyone explain how to do this or alternatives?

Extension of the problem:
I have a condition WHERE INthat I have to fill with the cursor at runtime. Since, as far as I know, I can only fill it with a hard-coded literal, or SELECTI need to save everything IN'sthat the user selected during the session.

+3
source share
4 answers

. , , - , , .

, .

:

  • . , , . - , .
  • Oracle , . , (.. ). , , .
  • , , , . , . , , , .

"-":

create or replace package bob as
  procedure do_stuff;
end bob;

create or replace package body bob as
  type my_table is table of varchar2(100) index by varchar2(100);
  my_variable my_table;

procedure do_stuff
begin
  --do stuff to my_variable
end;

begin
  --initialise my_variable
end bob;
+5

, , . , .

O'Reilly , , PACKAGE, , , PACKAGE BODY - var.

+2

, , "/", . SQL- IN EXIST .

+1
0

Source: https://habr.com/ru/post/1716026/


All Articles