Oracle Boolean

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm able to create a parameter with a type of Boolean in my Oracle stored
procedure, but when I look at the data types that I have available to me when
I am creating the parameter, I do not see a boolean data type. What type do
I select in order to pass a boolean value?

Thanks in advance for your assistance
 
In Oracle, I use a NUMBER(1), a bit, for true/false types of decisions. This
means you have to translate from true/false to 1/0 before throwing at the
sproc. There is no Boolean type in Oracle.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Cowboy said:
In Oracle, I use a NUMBER(1), a bit, for true/false types of decisions. This
means you have to translate from true/false to 1/0 before throwing at the
sproc. There is no Boolean type in Oracle.

This is fine, but do yourself a favor and put a constraint on this so 1
and 0 are the only valid options. Creative developers may decide to use
other values someday and mess everything up. While you're at it, set a
default value of 0, and set it "not null".
 
Back
Top