Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Posts
    6

    Unanswered: boolean in oracle

    what datatype shall i use to store true and false values in oracle?

  2. #2
    Join Date
    Jul 2002
    Posts
    29
    You can use the BOOLEAN datatype in your PL/SQL programs to store TRUE/FALSE valuse.

    But you cant store boolean values in the database. Use a number datatype instead.

    -- rajXesh

  3. #3
    Join Date
    Jan 2004
    Posts
    6

    use of boolean in pl/sql

    CAn somebody show me a example of checking the value of a boolean variable in my pl/sql procedure.

    thanks.

  4. #4
    Join Date
    Mar 2004
    Posts
    7
    DECLARE
    L_Flag Boolean;

    BEGIN
    L_Flag:= TRUE; -- change this to FALSE and re-test it, it works.

    IF L_Flag
    THEN
    DBMS_OUTPUT.PUT_LINE('Flag is True');
    ELSE
    DBMS_OUTPUT.PUT_LINE('Flag is False');
    END IF;

    -- You can also compare BOOLEAN as follows
    IF L_Flag = TRUE
    THEN
    DBMS_OUTPUT.PUT_LINE('Flag is True');
    END IF;

    -- You can not output the value in L_Flag with a DBMS_OUTPUT as follows
    -- the following gives an Error
    -- DBMS_OUTPUT.PUT_LINE(L_Flag);
    END;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •