Attaching Text file and sending mail

Hi all,
          I am trying to attach a text file (ASCII file) and send using mail.
          I am not able to get proper data in attachement.Can anyone suggest me which type should i use
          to get the data in proper format.
          i was using RAW file. I found we dont have specific Text format.
         Its possible for XLS format, i need only text file to be attached.
Thanks,
Rajesh
Edited by: rajesh pattnaik on Apr 16, 2009 3:03 PM

Hi,
After bringing your final alv data in the final internal table,
go through this link , i also had an same requirement to send data after converting to excel file and
send it as an attachment to mail id outside Sap,
https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/to%252bsend%252b2%252bint%252btables%252bdata%252bas%252btwo%252battachments%252bto%252bmail%252bid%252boutside%252bsap%252bsystem
I did this object and it was working fine using that function module.
Hope it helps
Regrds
Mansi

Similar Messages

  • Zip a text file and send as email attachment

    Hi,
      I have a requirement to zip a text file and send it as an email attacment. I saw many posts with similar discussion on the forum but none gave me a very clear answer. Have anyone done this? If so please help.
    Regards,
    Hari.

    Hi Durairaj,
    I am working in ECC 6.0 and all ZIP classes are available in my system. I am converting the ABAP spool to PDF. My PDF is too long (57MB) that i need to convert it to ZIP  before i send it as a mail attachment. How do i do this?
    Thanks,
    RS

  • Attaching HTML file and sending through mail

    Hi
    My Requirement is
    I want to attach HTML File and send through mail id's.
    But there are number of html files
    user can select any  one file.
    it has to attach and send to the mail id.

    Hi V,
    check the link:
    http://wiki.sdn.sap.com/wiki/display/Snippets/SendEmailwithHTMLattachment.

  • Convert XML to text file and sending the same via Mail receiver adapter

    Dear All,
    I have a requirement like....
    I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
    the converted file needs to be sent to a mail address in text format.
    Any body has idea how to achieve this?
    Thanks in advance for your help.
    Regards
    Hari

    >
    HP CReddy wrote:
    > Dear All,
    >
    > I have a requirement like....
    >
    > I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
    > the converted file needs to be sent to a mail address in text format.
    >
    > Any body has idea how to achieve this?
    >
    > Thanks in advance for your help.
    >
    > Regards
    > Hari
    use the StructXML2Plain or XML2Plain from the standard MessageTransformBean
    Add the module to you Mail adapter before the mail adapters standard module itself
    Ref: http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

  • Convert spool in the text format and send mail

    Hi All
    Can anyone tell me
    how to convert the spool into the text format and send that in email as an attachment..
    Points will be rewarded
    URGENT

    Hi,
    Read spool using FM  RSPO_RETURN_ABAP_SPOOLJOB
    CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
        EXPORTING
          rqident                  = v_rqident   "Spool Number
      FIRST_LINE                 = 1
      LAST_LINE                  =
        TABLES
          buffer                     = i_spool "Internal table output
    You will get spool in internal table and then its your game, play the way you want.
    Regards,
    Mandeep

  • How to zip a text file and send as email attachment in SAP version 4.6c?

    Hi Guru,
    How to zip a text file in SAP version 4.6c which doesn't have class CL_ABAP_ZIP?
    Please help.
    Thanks & Regards,
    Ari

    Hi,
    Try this link
    [http://sap.ittoolbox.com/groups/technical-functional/sap-dev/sapr3dev-zip-file-from-sap-1707099?cv=expanded]
    Cheers,
    Surinder

  • TS3899 I am unable to attach any files while sending mail

    Please tell me how to attach any word or pic or audio file while sending a mail using MAIL in my iphone 4.

    Step 1
    Remove "MacKeeper" as follows. First, back up all data.
    "MacKeeper" has only one useful feature: it deletes itself.
    Note: These instructions apply to the version of the product that I downloaded and tested in early 2012. I can't be sure that they apply to other versions.
    IMPORTANT: "MacKeeper" has what the developer calls an “encryption” feature. In my tests, I didn't try to verify what this feature really does. If you used it to “encrypt” any of your files, “decrypt” them before you uninstall, or (preferably) restore the files from backups made before they were “encrypted.” As the developer is not trustworthy, you should assume that the "decrypted" files are corrupt unless proven otherwise.
    In the Finder, select
    Go ▹ Applications
    from the menu bar, or press the key combination shift-command-A. The "MacKeeper" application is in the folder that opens. Quit it if it's running, then drag it to the Trash. You'll be prompted for your login password. Click the Uninstall MacKeeper button in the dialog that appears. All the functional components of the software will be deleted. Reboot.
    ☞ Quit MacKeeper before dragging it to the Trash.
    ☞ Don't empty the Trash. Let MacKeeper delete itself.
    ☞ Don't try to drag the MacKeeper Dock icon to the Trash.
    Step 2
    From the Safari menu bar, select
    Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data
    and confirm. Test.

  • In PI how do I convert the XML payload (input) to a text file and send out

    I am extracting data from SAP and sending thru XI / PI to a file (non-sap system).
    On the receiving end, I need the file to be a text file, with one row for each "FTZ_Row concatenated_data" tag in the input.  It needs to be just a plain text file with no XML tags.
    Currently the file gets one record which matches exactly to the XML payload below.
    I want it to create a file that looks like this :
               CONCATENATED DATA 1
               CONCATENATED DATA 2
                012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12
    here is the payload going thru XI
      <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
      <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
      <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
      <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
      </n0:FTZ_Concatenated_Row>
    thanks
    jay

    thanks for the input but I am still having issues - I get an empty file when I use the content conversion option.
    My payload coming into XI is :
            <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
    <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
    <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
    </n0:FTZ_Concatenated_Row>
    Here is the layout of my data type - I am using the same for input & output
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" targetNamespace="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone">
       <xsd:complexType name="FTZ_Concatenated_Row">
          <xsd:sequence>
             <xsd:element name="FTZ_Row" maxOccurs="unbounded">
                <xsd:complexType>
                   <xsd:attribute name="concatenated_data" type="xsd:string" />
                </xsd:complexType>
             </xsd:element>
          </xsd:sequence>
       </xsd:complexType>
    </xsd:schema>
    I mapped these items :  FTZ_Concatenated_Row & FTZ_Row & concatenated_data
    I set up my content convesion with :
      recordset structure   FTZ_Row
    FTZ_Row.fieldSeparator     #
    FTZ_Row.endSeparator     'nl'
    I am not sure why the following row looks like this ??
        <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    I thought FTZ_Row would be one tag and "concatenated_data" would be another one.
    any help would be appreciated.
    I have read many entries/blogs/etc in SDN but and tried many different setups, but nothing is working.
    thanks

  • How to Convert internal table data into text output and send mail in ABAP

    Hi All,
    Good Morning.
    Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
    But thought of doing it without excel.
    I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!.  Instead I  want to send this output to User's mails as Normal mail body with No attachments.
    Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
    as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
    Best Regards
    Dileep VT

    here's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
    notice we use gt_text as "mail body"
    TRY.
    *     -------- create persistent send request ------------------------
           gv_send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
    *     create text to be sent
           wa_line = text-001.
           APPEND wa_line TO gt_text.
           CLEAR wa_line.
           APPEND wa_line TO gt_text.
           LOOP AT gt_fail ASSIGNING <fs_fail>.
             MOVE <fs_fail>-retry_count TO gv_count.
             CONCATENATE text-002
                         <fs_fail>-setting_id
                         text-003
                         gv_count
                         INTO wa_line SEPARATED BY space.
             APPEND wa_line TO gt_text.
             CLEAR wa_line.
           ENDLOOP.
           APPEND wa_line TO gt_text.
           wa_line = text-007.
           APPEND wa_line TO gt_text.
    *     create actual document
           gv_document = cl_document_bcs=>create_document(
                           i_type    = 'RAW'
                           i_text    = gt_text
                           i_length  = '12'
                           i_subject = 'Failed Precalculation Settings!' ).
    *     add document to send request
           CALL METHOD gv_send_request->set_document( gv_document ).
    *     --------- set sender -------------------------------------------
           gv_sender = cl_sapuser_bcs=>create( sy-uname ).
           CALL METHOD gv_send_request->set_sender
             EXPORTING
               i_sender = gv_sender.
    *     --------- add recipient (e-mail address) -----------------------
           LOOP AT s_email INTO wa_email.
             MOVE wa_email-low TO gv_email.
             gv_recipient = cl_cam_address_bcs=>create_internet_address(
                                               gv_email ).
             CALL METHOD gv_send_request->add_recipient
               EXPORTING
                 i_recipient = gv_recipient
                 i_express   = 'X'.
           ENDLOOP.
    *     ---------- set to send immediately -----------------------------
           CALL METHOD gv_send_request->set_send_immediately( 'X' ).
    *     ---------- send document ---------------------------------------
           CALL METHOD gv_send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
             RECEIVING
               result              = gv_sent_to_all ).
           IF gv_sent_to_all = 'X'.
             WRITE text-004.
           ENDIF.
           COMMIT WORK.
    *   exception handling
         CATCH cx_bcs INTO gv_bcs_exception.
           WRITE: text-005.
           WRITE: text-006, gv_bcs_exception->error_type.
           EXIT.
       ENDTRY.
    with the following declarations
    * TABLES                                                               *
    TABLES:
       adr6,
       rsr_prec_sett.
    * INTERNAL TABLES & WORK AREAS                                         *
    DATA:
       gt_fail          TYPE SORTED TABLE OF rsr_prec_sett
                             WITH UNIQUE KEY setting_id run_date,
       gt_text          TYPE bcsy_text,
       wa_fail          LIKE LINE OF gt_fail,
       wa_line(90)      TYPE c.
    FIELD-SYMBOLS:
       <fs_fail>        LIKE LINE OF gt_fail.
    * VARIABLES                                                            *
    DATA:
       gv_count(4)      TYPE n,
       gv_send_request  TYPE REF TO cl_bcs,
       gv_document      TYPE REF TO cl_document_bcs,
       gv_sender        TYPE REF TO cl_sapuser_bcs,
       gv_recipient     TYPE REF TO if_recipient_bcs,
       gv_email         TYPE adr6-smtp_addr,
       gv_bcs_exception TYPE REF TO cx_bcs,
       gv_sent_to_all   TYPE os_boolean.
    * SELECTION-SCREEN                                                     *
    SELECT-OPTIONS:
       s_email          FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
    DATA:
       wa_email         LIKE LINE OF s_email.

  • Is it possible to zip a file and send it as an attachment in a mail?

    Hi,
    Is it possible to zip a file and send it as an attachment in a mail?

    When you use OWA in something other than IE, you're using OWA lite and no--it is not possible to do either in OWA lite (well, new Exchange stuff makes my answer a little less emphatic but still: pretty much no). Thanks Microsoft. But this guy made it possible to mark unread/read and select all/none:
    http://david-burger.blogspot.com/2008/07/firefox-greasemonkey-outlook-web-access_19.html

  • Converting html file into zip file and send email attaching zip file

    Hi Experts,
    I am trying to send email with attachment(html). Which contains more than 7MB. So, It is throwing an error like Size exceeded.
    So, Now i need to compress the data for less than 7MB.
    I decided to convert HTML File into ZIP File.
    Kindly suggest me to convert the HTML file into ZIP file and sending email with attached ZIP file.
    Correct answer rewarded,
    Thanks & Regards,
    N. HARISH KUMAR

    Hi Experts,
    *// HTML_TAB converting into ZIP File
       DATA  : zip_tool TYPE REF TO cl_abap_zip,
               filename TYPE string ,
               filename_zip TYPE string .
       DATA  : t_data_tab TYPE TABLE OF x255,
               bin_size TYPE i,
               buffer_x TYPE xstring,
               buffer_zip TYPE xstring.
    filename = text-007.                                                                          "'HTML_TAB
    *describe the attachment
       DESCRIBE TABLE html_tab LINES tab_lines.
       bin_size = tab_lines * 255.
       CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
         EXPORTING
           input_length = bin_size
         IMPORTING
           buffer       = buffer_x
         TABLES
           binary_tab   = html_tab.
       IF sy-subrc <> 0.
    *     message id sy-msgid type sy-msgty number sy-msgno
    *     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    *create zip tool
       CREATE OBJECT zip_tool.
    *add binary file
       CALL METHOD zip_tool->add
         EXPORTING
           name    = 'FSSAI_MAIL.HTML'
           content = buffer_x.
    *get binary ZIP file
       CALL METHOD zip_tool->save
         RECEIVING
           zip = buffer_zip.
       CLEAR: t_data_tab[],bin_size.
       CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
         EXPORTING
           buffer        = buffer_zip
         IMPORTING
           output_length = bin_size
         TABLES
           binary_tab    = html_tab.
    Thanks & Regards,
    N. HARISH KUMAR

  • How do I record a sound file and send it as an attachment using my 4s?

    How do I record a sound file and send it as an attachment using my 4s?

    Hi,
    The following is the program[Click Here| http://saptechnical .com/Tips/ABAP/email/EmailProgram.txt] which will send any format file. Actual Creator of the program is Amit Bisht.
    Thanks & Regards,
    Rock.

  • Convertion of Smart form to pdf and sending mail to vendor for PO

    Hello all,
    I have modified a standard PO Smartform and running it through ME23N.
    In this i have to convert it to a pdf file and then send it through mail to the vendor.
    I have found out FMs'CONVERT_OTF'and
    'SO_NEW_DOCUMENT_ATT_SEND_API1'
    to convert it and send mail. But can u tell me how to go about using it.
    As i am using a standard program do i have to copy this prog to zprog and then call the fm out there. I am not sure.
    Thanks
    Salil

    Hi,
    Here is the sample code.If you find this as useful,kindly reward points by clicking the star on the left of reply.
    Internal Table declarations
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
          i_tline TYPE TABLE OF tline WITH HEADER LINE,
          i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
          i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
          i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
          i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
          w_objhead TYPE soli_tab,
          w_ctrlop TYPE ssfctrlop,
          w_compop TYPE ssfcompop,
          w_return TYPE ssfcrescl,
          w_doc_chng typE sodocchgi1,
          w_data TYPE sodocchgi1,
          w_buffer TYPE string,"To convert from 132 to 255
    Variables declarations
          v_form_name TYPE rs38l_fnam,
          v_len_in LIKE sood-objlen,
          v_len_out LIKE sood-objlen,
          v_len_outn TYPE i,
          v_lines_txt TYPE i,
          v_lines_bin TYPE i.
    call function 'SSF_FUNCTION_MODULE_NAME'
         exporting
              formname           = 'ZZZ_TEST2'
         importing
              fm_name            = v_form_name
         exceptions
              no_form            = 1
              no_function_module = 2
              others             = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    w_ctrlop-getotf = 'X'.
    w_ctrlop-no_dialog = 'X'.
    w_compop-tdnoprev = 'X'.
    CALL FUNCTION v_form_name
         EXPORTING
              control_parameters = w_ctrlop
              output_options     = w_compop
              user_settings      = 'X'
         IMPORTING
              job_output_info    = w_return
         EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    i_otf[] = w_return-otfdata[].
    CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
              format                = 'PDF'
              max_linewidth         = 132
         IMPORTING
              bin_filesize          = v_len_in
         TABLES
              otf                   = i_otf
              lines                 = i_tline
         EXCEPTIONS
              err_max_linewidth     = 1
              err_format            = 2
              err_conv_not_possible = 3
              OTHERS                = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Convert PDF from 132 to 255.
    LOOP AT i_tline.
    Replacing space by ~
      TRANSLATE i_tline USING ' ~'.
      CONCATENATE w_buffer i_tline INTO w_buffer.
    ENDLOOP.
    Replacing ~ by space
    TRANSLATE w_buffer USING '~ '.
    DO.
      i_record = w_buffer.
    Appending 255 characters as a record
      APPEND i_record.
      SHIFT w_buffer LEFT BY 255 PLACES.
      IF w_buffer IS INITIAL.
        EXIT.
      ENDIF.
    ENDDO.
    Refresh: i_reclist,
             i_objtxt,
             i_objbin,
             i_objpack.
    clear    w_objhead.
    Object with PDF.
    i_objbin[] = i_record[].
    DESCRIBE TABLE i_objbin LINES v_lines_bin.
    Object with main text of the mail.
    i_objtxt = 'Find attached the output of the smart form.'.
    APPEND i_objtxt.
    i_objtxt = 'Regards,'.
    APPEND i_objtxt.
    i_objtxt = 'J.Jayanthi'.
    APPEND i_objtxt.
    DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    Document information.
    w_doc_chng-obj_name = 'Smartform'.
    w_doc_chng-expiry_dat = sy-datum + 10.
    w_doc_chng-obj_descr = 'Smart form output'.
    w_doc_chng-sensitivty = 'F'. "Functional object
    w_doc_chng-doc_size = v_lines_txt * 255.
    Pack to main body as RAW.
    Obj. to be transported not in binary form
    CLEAR i_objpack-transf_bin.
    Start line of object header in transport packet
    i_objpack-head_start = 1.
    Number of lines of an object header in object packet
    i_objpack-head_num = 0.
    Start line of object contents in an object packet
    i_objpack-body_start = 1.
    Number of lines of the object contents in an object packet
    i_objpack-body_num = v_lines_txt.
    Code for document class
    i_objpack-doc_type = 'RAW'.
    APPEND i_objpack.
    Packing as PDF.
    i_objpack-transf_bin = 'X'.
    i_objpack-head_start = 1.
    i_objpack-head_num = 1.
    i_objpack-body_start = 1.
    i_objpack-body_num = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'Smartform'.
    CONCATENATE 'Smartform_output' '.pdf'
    INTO i_objpack-obj_descr.
    i_objpack-doc_size = v_lines_bin * 255.
    APPEND i_objpack.
    Document information.
    CLEAR i_reclist.
    e-mail receivers.
    i_reclist-receiver = '[email protected]'.
    i_reclist-express = 'X'.
    i_reclist-rec_type = 'U'. "Internet address
    APPEND i_reclist.
    Sending mail.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
              document_data              = w_doc_chng
              put_in_outbox              = 'X'
         TABLES
              packing_list               = i_objpack
              object_header              = w_objhead
              contents_hex               = i_objbin
              contents_txt               = i_objtxt
              receivers                  = i_reclist
         EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              OTHERS                     = 8.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to attach a file to the mail

    How to attach a file to the mail

    I know that this can be done when going to any PDF program and push (send as  email)
    This also can done with multiple files or even with separate pages from that PDF file (Many programs can do that, like: PDF expert, Adobe Reader, iBooks, PDF Provider, Documents, etc)
    But what if I begin to wright an email, then I wanted to attach a file (such as PDF, or word, or any file) , FOR BASIC APPLE MAIL IT IS UNAVAILABLE
    You can attach Photo or Video but not PDF or other document
    There are some email programs that can attach files to email such as my.mail (as you can see from the photo)
    But why Apple don't provide such simple service ???

  • Oracle Zip and Send Mail

    Hi,
    I was just wondering if there is a pl/sql code that would do the following:
    1. Zip a file (originally generated from DB query written to Unix OS using UTL_FILE package).
    2. Place a password on the file.
    3. Send the file as an attachment in mail.
    Thanks in advance.

    For compression, you can use UTL_COMPRESS package.
    [oracle@db11ghost ~]$ cat compress_data.txt
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa
    bbbbbbbbbbbbbbbbbbbbbbbbbbbb
    cccccccccccccccccccccccccccc
    [oracle@db11ghost ~]$
    Below is example how to load file to table as compressed blob. Later you can save this blob to file (pls, search google there are many examples how to do it) and send mail as attach.
    SQL> create directory MYDIR as '/home/oracle/';
    Directory created.
    declare
      ablob blob;
      abfile bfile := bfilename('MYDIR', 'compress_data.txt');
      amount integer;
      asize integer;
      a_compressed_blob blob;
      q integer := 1; ---- The level of compression from 1-9
      cursor blob_cur is select * from myt1;
    begin
      insert into myt1 values (1, empty_blob());
      select y into ablob from myt1 where x = 1;
      dbms_lob.fileopen(abfile);
      asize := dbms_lob.getlength(abfile);
      dbms_output.put_line('Size of input file: ' || asize);
      -- load the file (txt file) into the blob column and look at the size
      dbms_lob.loadfromfile(ablob, abfile, asize);
      asize := dbms_lob.getlength(ablob);
      dbms_output.put_line('Size of blob after loading fromfile: ' || asize);
      -- compress the blob
      a_compressed_blob := utl_compress.lz_compress(ablob, q);
      -- insert the compressed blob into the table in another row
      insert into myt1 values (2, a_compressed_blob);
      -- compare the sizes of the blob contents that are in the table now
      dbms_output.put_line('Sizes are -->');
      for c1_rec in blob_cur
        loop
        asize := dbms_lob.getlength(c1_rec.y);
        dbms_output.put_line(asize);
      end loop;
    end;
    Size of input file: 87
    Size of blob after loading fromfile: 87
    Sizes are -->
    87
    32
    PL/SQL procedure successfully completed.For sending you can use UTL_MAIL (http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm#i1001258)

Maybe you are looking for

  • Help, web browser is locking up my 8320!

    So I have no clue whats going on.  I was in the webbrowser trying to figure out how to organize my bookmarks.  I never actually got a chance to do anything other than access the help on the phone for how to delete a bookmark.  I exited out of the hel

  • Table bseg vendor / customer

    hello. How do i know which one is customer or vender. Is their a field taht specifies that? Thanks.

  • How can I count detail information without having it show up in my results

    I'm trying to count the number of sales orders within specific value ranges such as 0 to 100, 100 to 200, ect. I can get the count but only when the order number is on the report. Is there someway to count the orders and place them in the Bins withou

  • Thread synch

    Hi all! I wrote an application using RMI. A client calls an RMI method of a server. The method checks some conditions and if it is necessary I use wait() to wait the current thread. A different client calls a different RMI method in order to notify t

  • How to search for packages that Names including "'" [solved]

    Hi everyone first ,forgive my english lvevel and I want to know How to search for packages that Names including "'" for instance $ pacman -Ss America's Army it returned > Please help me ,many thanks! Last edited by icywalk (2010-04-05 13:09:26)