Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.oracle.server    |    Oracle Sysadmins question their careers    |    44,300 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 43,211 of 44,300    |
|    Mzwanele Ngubane to All    |
|    how can I allow this procedure to attach    |
|    19 Feb 19 21:04:34    |
   
   From: ngubanemj@gmail.com   
      
   The base procedure mail_attach_binary(created below) to e-mail binary files   
   from a directory location on the database (/home/alert)   
      
      
   My Question is from here how can at   
   how can I allow this procedure to attach to email(pdf file in the directory),   
   pdf file that is > 32000 bytes?   
      
      
   --SPEC   
   PROCEDURE mail_attach_binary   
    (recipients VARCHAR2,   
    cc VARCHAR2 DEFAULT NULL,   
    subject VARCHAR2,   
    message VARCHAR2 DEFAULT NULL,   
    att_filename VARCHAR2 DEFAULT NULL,   
    att_file_loc VARCHAR2);   
   END SPP_EMAIL;   
      
   --BODY   
   PROCEDURE mail_attach_binary   
    (recipients VARCHAR2,   
    cc VARCHAR2,   
    subject VARCHAR2,   
    message VARCHAR2,   
    att_filename VARCHAR2,   
    att_file_loc VARCHAR2) AS   
   --file attachment paramaters   
    v_bfile BFILE;   
    v_clob CLOB;   
    destOffset INTEGER:=1;   
    srcOffset INTEGER := 1;   
    lang_context INTEGER := DBMS_LOB.default_lang_ctx;   
    warning INTEGER;   
      
   -- v_mime_type VARCHAR2(30) := 'application/pdf';   
      
    BEGIN   
      
    setup_smtp_server;   
   --Get the file to attach to the e-mail   
    v_bfile := BFILENAME (att_file_loc, att_filename);   
    DBMS_LOB.OPEN (v_bfile);   
    DBMS_LOB.CREATETEMPORARY(v_clob, TRUE, DBMS_LOB.SESSION);   
    DBMS_LOB.LOADCLOBFROMFILE(   
    dest_lob => v_clob,   
    src_bfile => v_bfile,   
    amount => DBMS_LOB.GETLENGTH(v_bfile),   
    dest_offset => destOffset,   
    src_offset => srcOffset,   
    bfile_csid => DBMS_LOB.default_csid,   
    lang_context => lang_context,   
    warning => warning);   
    DBMS_LOB.CLOSE(v_bfile);   
      
    EXCEPTION WHEN   
    INVALID_ARGUMENT THEN   
    alert('EMAIL',1000,'Invalid argument passed to e-mail attachment from   
   utl_mail.send_attach_varchar2');   
    END mail_attach_binary;   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca