Is it possible to perform a bitwise group function?

后端 未结 5 995
轻奢々
轻奢々 2020-12-09 10:02

I have a field in a table which contains bitwise flags. Let\'s say for the sake of example there are three flags: 4 => read, 2 => write, 1 => execute a

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 10:31

    And you can do a bitwise or with...

    FUNCTION BITOR(x IN NUMBER, y IN NUMBER)
    RETURN NUMBER
    AS
    BEGIN
        RETURN x + y - BITAND(x,y);
    END;
    

提交回复
热议问题