I am using oracle 11g and I am trying to figure out the length of the text. I usually use the select (myvar) length from the table, but I cannot do this.
The table I want to query has a BLOB column that stores characters or photos. I want to know the number of characters that my BLOB column has.
I tried converting my BLOB to char using UTL_RAW.CAST_TO_VARCHAR2 (myblob) from the table, but these functions do not work correctly or maybe I'm wrong.
For example: My BLOB has the word Section, when I see this in the database in hexadecimal, I see Section. I don't know why it has these dots between each letter. Then I used this query
select UTL_RAW.CAST_TO_VARCHAR2(myblob) from table
The result of this query is "S", so this is not the full word that my BLOB has, and when I make this query
select length(UTL_RAW.CAST_TO_VARCHAR2(myblob)) from table
the result is 18, and the word Sections does not have 18 characters.
I tried to convert blob to varchar, although I think that my best bet would be clob, because the length of the text that it can save is longer than the limit that varchar has. I tried to do this by running this query (I'm not sure if this is correct, but this is what I found on the Internet)
select UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(myblob, 32767, 1)) from table
This query also returns 'S'
Hope you can help me with this problem. thanks for advanced