Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How to get the length of LONG RAW column
Hi,
Oracle9i 9.2.0.6
How can I get the length of a LONG RAW column from sqlplus/plsql? It looks like the following works for RAW datatype ONLY.
Create utl_raw package
@$ORACLE_HOME/rdbms/admin/utlraw.sql.
$ORACLE_HOME/rdbms/admin/prvtrawb.plb
SET SERVEROUTPUT ON SIZE 1000000
DECLARE
a NUMBER;
b LONG RAW;
CURSOR c1 is SELECT c1 FROM junk;
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO b ;
EXIT WHEN c1%NOTFOUND;
a := utl_raw.length(b);
DBMS_OUTPUT.PUT_LINE('LENGTH OF COLUMN IS = ' || a);
END LOOP;
END;
/
Thanks
wagen
Received on Wed Jan 12 2005 - 17:47:36 CST