Skip to content

Instantly share code, notes, and snippets.

@develost
Created May 17, 2018 13:52
Show Gist options
  • Save develost/e39455e2cf15275d400f8ab881a62e94 to your computer and use it in GitHub Desktop.
Save develost/e39455e2cf15275d400f8ab881a62e94 to your computer and use it in GitHub Desktop.
Oracle example of MEMBER OF function
create type typ_number_table IS TABLE OF NUMBER;
declare
ptyp_list typ_number_table;
begin
ptyp_list := typ_number_table();
ptyp_list.extend;
ptyp_list(ptyp_list.last) := 88;
ptyp_list.extend;
ptyp_list(ptyp_list.last) := 90;
if (1 member of ptyp_list) then
DBMS_OUTPUT.put_line ('not ok');
else
DBMS_OUTPUT.put_line ('ok');
end if;
if (2 member of ptyp_list) then
DBMS_OUTPUT.put_line ('not ok');
else
DBMS_OUTPUT.put_line ('ok');
end if;
if (88 member of ptyp_list) then
DBMS_OUTPUT.put_line ('ok');
else
DBMS_OUTPUT.put_line ('not ok');
end if;
if (90 member of ptyp_list) then
DBMS_OUTPUT.put_line ('ok');
else
DBMS_OUTPUT.put_line ('not ok');
end if;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment