Note that there are some explanatory texts on larger screens.

plurals
  1. POconvert blob to clob
    primarykey
    data
    text
    <p>I'm using oracle 11g and I'm trying to find out the length of a text. I will normally use select length(myvar) from table, but I can't do that.</p> <p>The table which I want to query has a BLOB column that saves characters or photos. I want to know the number of characters that have my BLOB column.</p> <p>I tried to convert my BLOB into a char using UTL_RAW.CAST_TO_VARCHAR2(myblob) from table, but this functions isnt't working correctly or maybe I'm making a mistake. </p> <p>For example: My BLOB have the word Section, when I see this in the databse in the hexadecimal form I see S.e.c.t.i.o.n.. I dont'k know why it have those points in between each letter. Then I used the this query </p> <pre><code>select UTL_RAW.CAST_TO_VARCHAR2(myblob) from table </code></pre> <p>The result of this query is 'S' so it's not the complete word that my BLOB has, and when I make this query</p> <pre><code>select length(UTL_RAW.CAST_TO_VARCHAR2(myblob)) from table </code></pre> <p>the result is 18 and the word Sections doesn't have 18 characters.</p> <p>I was trying to convert the blob into a varchar, although I think my best choise would be a clob because the length of the text that it can save is more than the limit that varchar has. I tried to do that by making this query (I'm not sure if this is correct but is what I found in the internet)</p> <pre><code>select UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(myblob, 32767, 1)) from table </code></pre> <p>This query also returns 'S' </p> <p>I hope you can help me with this problem. thanks for advanced</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload