Вообще грустно, что нет красивого и удобного решения, применимые варианты скудны, если хочется создать нормальный тип-перечисление с возможностью использования вроде:
declare
var my_typelist;
begin
var:= my_typelist.value1;
end;
все что более менее приближенно к этому:
1. создание пакета типа my_typelist_values с константами - тогда можно использовать так:
declare
var my_typelist;
begin
var:= my_typelist_values.value1;
end;
2. создание типа и объекта - аналог пакета с константами
3. создание объекта my_typelist:
create or replace type my_typelist as object (
value integer,
static function value1 return my_typelist,
static function value2 return my_typelist
)
/
create or replace type body my_typelist as
static function value1 return my_typelist as
begin
return my_typelist(1);
end;
static function value2 return my_typelist as
begin
return my_typelist(2);
end;
end;
/
и использовать:
declare
var my_typelist;
begin
var:=my_typelist.value1;
dbms_output.put_line(var.value);
end;
В общем, жаль... Остается надеяться, что в будущем oracle все-таки сделает нормальные enum'ы...
Comments
But 메리트카지노 we’ll element it step-by-step beneath too, just to assist you alongside your path to assert one of the best on-line casino promotions. These bonuses are all the time tremendously appreciated since they don’t involve the bettor having to actually deposit any money. No deposit rewards are usually free spins on the slot machines, free chips on the poker or roulette desk, and so forth. The excellent news is you'll be able to|you possibly can} declare this welcome bonus provide as much as} three times!
Отправить комментарий