Bool_to_int
390020Aug 5 2003 — edited Aug 5 2003Hi everyone.
i got a table with a column which type is number.
the idea is to store there a boolean value (0/1)
i store the values with a function with a boolean parameter. i, then, converse the boolean with diutil.bool_to_int().
however when i try to compile, i get the PLS-00382: expression is of wrong type and i don't know why.
As example:
create table valores
(id number,
boolean_value number);
alter table valores
add constraint SSP_CK5
check (boolean_value IN (0,1));
create or replace function intro
(p_id in valores.id%type,
p_valor in boolean default true)
return boolean is
begin
insert into valores (id, boolean_value)
values (p_id, sys.diutil.bool_to_int(p_valor));
commit work;
return true;
end intro;
By the way, i'm working in 9i.
Regards.-