BIT_AND Function
This function performs bitwise logical "and" of the values in RAW r1 with RAW r2 and returns the "anded" result RAW. If r1 and r2 differ in length, then the "and" operation is terminated after the last byte of the shorter of the two RAWs, and the unprocessed portion of the longer RAW is appended to the partial result. The result length equals the longer of the two input RAWs. Syntax
UTL_RAW.BIT_AND (
r1 IN RAW,
r2 IN RAW)
RETURN RAW;看了以上内容明白了吗?它是一个函数,返回一个RAW,那要在定义部定义一个raw型的变量,然后再赋给它.
This function performs bitwise logical "and" of the values in RAW r1 with RAW r2 and returns the "anded" result RAW. If r1 and r2 differ in length, then the "and" operation is terminated after the last byte of the shorter of the two RAWs, and the unprocessed portion of the longer RAW is appended to the partial result. The result length equals the longer of the two input RAWs. Syntax
UTL_RAW.BIT_AND (
r1 IN RAW,
r2 IN RAW)
RETURN RAW;看了以上内容明白了吗?它是一个函数,返回一个RAW,那要在定义部定义一个raw型的变量,然后再赋给它.
-- Sub-Program Units
FUNCTION GETBIT
(rawField RAW,
hexBit CHAR
)
RETURN CHAR
IS
BEGIN
RETURN rawtohex(utl_raw.bit_and(rawField, hextoraw(hexBit)));
END GetBit;
... ...运行的时候报上面的错误,有什么不对么
create or replace FUNCTION GETBIT
(rawField RAW,
hexBit CHAR
)
RETURN CHAR
IS
BEGIN
RETURN rawtohex(utl_raw.bit_and(rawField, hextoraw(hexBit)));
END GetBit;
:)