Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bool_to_int

390020Aug 5 2003 — edited Aug 5 2003
Hi 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.-
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2003
Added on Aug 5 2003
4 comments
2,091 views