View Single Post
  #14 (permalink)  
Old March 1st, 2007, 08:24 PM
RenePro RenePro is offline
Registered User
 
Join Date: Feb 2007
Location: , Sydney, Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know this kinda late maybe, but just thought maybe it helps others by adding this comment:

In Oracle you can set up a check constraint to sort of emulate the boolean idea e.g.

CREATE TABLE table_name
(
 column_name CHAR CHECK (column_name IN ('Y','N'))
);


or you can add a check constraint to an existing table e.g.

ALTER TABLE table_name ADD CONSTRAINT test_bool CHECK
(
 column_name IN('Y','N')
);

This of course depends on the column type you did setup in the table.

for the rest, there is a specific BOOLEAN type in PL/SQL when you declare you variable e.g.

DECLARE

variable_name BOOLEAN DEFAULT [FALSE/TRUE];

BEGIN
...
END;
/

Cheers
René