I've been asked to find the size of the largest value in a LONG RAW column of a table. Heaven knows why they're using LONG RAWs instead of BLOBs, but it's not in my power to change that.
I thought I'd start by getting the length of the value held in one row - going on to find the maximum should be trivial but possibly time consuming.
I can't use the LENGTH() or VSIZE() functions on a LONG RAW in regular SQL. I've tried using PL/SQL, but I get an ORA-6502 Numeric or Value Error when I try to select a value into a PL/SQL variable, like this for example:
Selecting [tt]TO_LOB(image_data)[/tt] gives another error message: "ORA-00932: inconsistent datatypes: expected - got BINARY".
Does anybody know how I can do this?
-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
I thought I'd start by getting the length of the value held in one row - going on to find the maximum should be trivial but possibly time consuming.
I can't use the LENGTH() or VSIZE() functions on a LONG RAW in regular SQL. I've tried using PL/SQL, but I get an ORA-6502 Numeric or Value Error when I try to select a value into a PL/SQL variable, like this for example:
Code:
DECLARE
CURSOR cDoc IS
SELECT image_data
FROM documents
WHERE id = 228;
BEGIN
FOR rDoc IN cDoc LOOP
NULL;
END LOOP;
END;
Does anybody know how I can do this?
-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd