Re: Copy Blob data into Varchar2

  • From: "Sanjay Mishra" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "smishra_97" for DMARC)
  • To: oracle-l@xxxxxxxxxxxxx, Mladen Gogala <gogala.mladen@xxxxxxxxx>
  • Date: Thu, 26 Mar 2020 00:54:18 +0000 (UTC)

 Mladen
Yes your point make sense as if data is real binary then select will display 
junk character. This current data is somehow stored by a third party 
application but has all text data. Not sure if this is kept blob due to some 
future requirement.
TxSanjay
    On Wednesday, March 25, 2020, 01:12:41 PM EDT, Mladen Gogala 
<gogala.mladen@xxxxxxxxx> wrote:  
 
  
The only type that realistically can be converted to VARCHAR2 is CLOB. 
Converting things like JPEG or MP3 to VARCHAR2 would take OCR or even more 
complex speech recognition to do. Maybe Alexa or Siri could do it for you?  
Personally, I would use pathologically eclectic rubbish lister to do that line 
by line. I would read CLOB field into $clob and then do something like this my 
@clob=split "\n",$clob;  to split it into lines. I would then re-insert all the 
lines from the @clob array as varchar2 columns.
 
 On 3/24/20 11:14 PM, Sanjay Mishra (Redacted sender smishra_97 for DMARC) 
wrote:
  
 
 Can someone share any function which can allow to insert BLOB data into 
Varchar2 column? Most of the BLOB data is less than 32K but selecting the BLOB 
using dbms_lob.substr( l_cur.mylob, 32000, 1 ) or utl_raw.cast_to_varchar2 gave 
error   
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
 
   Can someone share an example to convert data from BLOB to varchar ? 
  Tx Sanjay   -- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
   

Other related posts: