PL/SQL: numeric or value error when using DBMS_UTILITY.IS_BIT_SET
set serveroutput on;
declare
rawValue raw(10);
begin
rawValue := utl_raw.cast_to_raw('123');
dbms_output.put_line('raw:' || rawValue);
dbms_output.put_line('final:' || DBMS_UTILITY.IS_BIT_SET(rawValue, 1));
end;
/
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.UTL_RAW", line 380
ORA-06512: at "SYS.DBMS_UTILITY", line 672
ORA-06512: at "SYS.DBMS_UTILITY", line 679
ORA-06512: at line 6
But below code works.
set serveroutput on;
declare
rawValue raw(10);
begin
rawValue := utl_raw.cast_to_raw('1234');
dbms_output.put_line('raw:' || rawValue);
dbms_output.put_line('final:' || DBMS_UTILITY.IS_BIT_SET(rawValue, 1));
rawValue raw(10);
begin
rawValue := utl_raw.cast_to_raw('123');
dbms_output.put_line('raw:' || rawValue);
dbms_output.put_line('final:' || DBMS_UTILITY.IS_BIT_SET(rawValue, 1));
end;
/
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.UTL_RAW", line 380
ORA-06512: at "SYS.DBMS_UTILITY", line 672
ORA-06512: at "SYS.DBMS_UTILITY", line 679
ORA-06512: at line 6
But below code works.
set serveroutput on;
declare
rawValue raw(10);
begin
rawValue := utl_raw.cast_to_raw('1234');
dbms_output.put_line('raw:' || rawValue);
dbms_output.put_line('final:' || DBMS_UTILITY.IS_BIT_SET(rawValue, 1));
0