Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> send attachments
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?"
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.
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;
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