I have a table in Oracle that contains a field with the data type of LONG
. With the following function I'm trying to find out how many characters are stored in this LONG
field for a particular record in the table.
CREATE OR REPLACE FUNCTION Find_Length(i_nwt_id number)
RETURN NUMBER
IS
long_var LONG;
BEGIN
SELECT NWT_TEXT
INTO long_var
FROM qf.NWT
WHERE nwt_id=i_nwt_id;
RETURN length(long_var);
END;
I try to call it like the following:
select nwt_id, find_length(nwt_id)leng from nwt ;
Anyhow this select throws me an exception:
Numeric or value error!
Anyone could give me an hints what am I doing wrong?
Thanks!