Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Convert Boolean

Convert Boolean

From: Ian Ledzion <ian.ledzion_at_lgxbow.com>
Date: Tue, 17 Apr 2001 11:40:18 +0200
Message-ID: <9bh30t$g59$1@rex.ip-plus.net>

Is there a package function or other method to convert BOOLEAN values to something else, e.g. numeric within a query?

I've checked the built-in packages with no luck (though maybe I missed something), then tried my own function, which is below:

CREATE OR REPLACE
FUNCTION test_conv (p_boolean IN BOOLEAN)

   RETURN NUMBER
IS

   v_value NUMBER DEFAULT 0;
BEGIN
   IF p_boolean
   THEN
      v_value := 1;
   END IF;    RETURN v_value;
END;
/

This works fine in an anonymous SQL block, but no luck in a query. The error message I get is:

ORA-06552: PL/SQL: Statement ignored ORA-06553: PLS-382: expression is of wrong type

Any thoughts would be much appreciated. Received on Tue Apr 17 2001 - 04:40:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US