Home » SQL & PL/SQL » SQL & PL/SQL » Boolean Data type usage in PL/SQl Block (Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production)
Boolean Data type usage in PL/SQl Block [message #607601] Mon, 10 February 2014 03:48 Go to next message
saipradyumn
Messages: 419
Registered: October 2011
Location: Hyderabad
Senior Member

Hi ,

Can we assign True/Flase values into boolean variable in PL/SQL block by using SELECT statement ?

declare
  v_b1 boolean;
  v_b2 boolean;
begin

  v_b2 := sys.diutil.int_to_bool(1);
  --  select sys.diutil.int_to_bool(0) into v_b1 from dual;
  if v_b1 = TRUE then
    dbms_output.put_line('TRUE');
  else
    dbms_output.put_line('FALSE');
  end if;

  if v_b2 = TRUE then
    dbms_output.put_line('TRUE');
  else
    dbms_output.put_line('FALSE');
  end if;
end;



The above block was working fine, if it is direct assignment.But not working for select statements.
Please explain the logic behind this

Thanks
Sai Pradyumn


Re: Boolean Data type usage in PL/SQl Block [message #607602 is a reply to message #607601] Mon, 10 February 2014 03:58 Go to previous message
cookiemonster
Messages: 13967
Registered: September 2008
Location: Rainy Manchester
Senior Member
Boolean isn't a sql datatype so it can't be used in sql statements.
Previous Topic: SU@RE#SH$ i want the output as SURESH
Next Topic: NESTED TABLE & Analytical functions
Goto Forum:
  


Current Time: Thu Aug 21 21:16:41 CDT 2025