Wednesday, September 10, 2008

HOW TO DISPLAY BLOB IN SQLPLUS

SQL> DESC PS_PY_SSP_XML_DATA
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ATTACHSYSFILENAME                         NOT NULL VARCHAR2(128)
 FILE_SEQ                                  NOT NULL NUMBER(38)
 VERSION                                   NOT NULL NUMBER(38)
 FILE_SIZE                                 NOT NULL NUMBER(10)
 LASTUPDDTTM                                        DATE
 LASTUPDOPRID                              NOT NULL VARCHAR2(30)
 FILE_DATA                                          BLOB
 
 
declare
   b blob;
   dest_offset integer := 1 ;
   src_offset  integer := 1 ;
   lang_context integer:= 1 ;
   warning integer;
 begin
   select file_data  into b from  PS_PY_SSP_XML_DATA where rownum = 1  for update ;
   dbms_lob.createtemporary(:c,true);
   dbms_lob.converttoclob(
     :c, b, DBMS_LOB.LOBMAXSIZE,
     dest_offset, src_offset,
     1, lang_context, warning);
 end;
>>> This e-mail and any attachments are confidential, may contain legal, professional or other privileged information, and are intended solely for the addressee.  If you are not the intended recipient, do not use the information in this e-mail in any way, delete this e-mail and notify the sender. CEG-IP1 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home