I have a table with a column of data type LONG RAW
. How do I determine the size (in bytes) of the data in this column?
If I call the LENGTH
As long as the data in the column does not exceed 16,383 bytes, you can solve this with a PL/SQL function, e.g.
CREATE OR REPLACE FUNCTION get_lr_length (id IN NUMBER)
RETURN NUMBER IS
raw_data LONG RAW;
hex_data VARCHAR2(32767);
len NUMBER;
BEGIN
SELECT my_long_raw_column INTO raw_data
FROM my_table
WHERE my_table.id = get_lr_length.id;
hex_data := RAWTOHEX(raw_data);
len := LENGTH(hex_data) / 2;
RETURN len;
END get_lr_length;
Unfortunately, a LONG RAW can hold up to 2GB...