Sv: length of a long raw column

From: Jan Hansen <jan_at_IHATESPAMbrandsoft.dk>
Date: 2000/05/30
Message-ID: <Q7QY4.191$Bh5.4379_at_news.get2net.dk>#1/1


Try this solution using sqlplus.
Remember to 'set serveroutput on', or you will see no output.

declare
  my_raw long raw;
  cursor c1 is select foo from foobar;
begin
  open c1;
  fetch c1 into my_raw;
  loop
    exit when c1%notfound;
    dbms_output.put_line ('Col-length: ' || length(my_raw));     fetch c1 into my_raw;
  end loop;
  close c1;
end;
/

Explanation: length is not defined for raw columns in SQL, but it is defined for PL/SQL.

---Jan

> Hi Oracle PL/SQL experts,
>
> how do i examine the length of a long raw column
> with PL/SQL and sqlplus?
>
> Example:
> create table foobar (id number, foo long raw);
> insert into foobar values (1, '010101');
>
> select length(foo) from foobar
> *
> ERROR at line 1:
> ORA-00932: inconsistent datatypes
>
> Can Oracle PL/SQL experts there help me?
>
> Thanks
> Thomas
Received on Tue May 30 2000 - 00:00:00 CEST

Original text of this message