Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> send attachments

send attachments

From: Szecsy Tamas <tszecsy_at_GEOMETRIA.hu>
Date: Tue, 14 Nov 2000 15:56:54 +0100
Message-Id: <10680.121997@fatcity.com>


Hi,

Recently some one asked how to send attachments from Oracle 8i with smtp package.

I found this one on Oracle Magazine:

http://osi.oracle.com/wa/ask/owa/ask_tom_pkg.display?p_dispid=1031231846651& p_search_str=

Tamas Szecsy

Venku Reddy -- Thanks for the question regarding "How to send attachment with your mail program?"




You Asked

Iam trying send data as attachment.I observed that it accepts only blob variables. I want to send the file as attachment to process the data on the other hand. So I have to send the data as comma or tab delimited format. Is it possible. Mail.send program can read the files from operating system level.




and I said...

If you have the data in a text variable (varchar or whatnot), you can use utl_raw.cast_to_raw to convert the text into a raw type which can be written into a temporary blob.

for example:

ops$tkyte_at_ORA8I.WORLD> declare

  2          l_tmp blob;
  3          l_str varchar2(20000);
  4  begin
  5          dbms_lob.createtemporary( l_tmp, false );
  6  
  7          l_str := rpad( '*', 20000, '*' );
  8  
  9          dbms_lob.writeappend( l_tmp, length(l_str), 
                              utl_raw.cast_to_raw(l_str) );
 10 end;
 11 /

PL/SQL procedure successfully completed.

UTL_RAW may not be installed on your system. If not (there would be a grant execute to public and a public syonym if it is installed), simply:

o cd $ORACLE_HOME/rdbms/admin
o using SVRMGRL
o connect as INTERNAL or SYS (and only these 2 users, none Received on Tue Nov 14 2000 - 08:56:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US