Letters instead of numbers in graph

Hi OTN,
In my ADF BC application I have a bar graph. The graph looks like this: http://img846.imageshack.us/img846/1812/graphn.png
So, my question is: is there any possibility of replacing numbers on the top of bars with letters (1 is A, 2 is B and etc.)?
Type of graph is dvt:barGraph, ADF BC, Jdeveloper 11.1.1.4

Done in with custom converter.
<dvt:markerText id="markerText1" rendered="true">
                <dvt:y1Format autoPrecision="off">
                  <f:converter converterId="estimationFormatter"/>
                </dvt:y1Format>
            </dvt:markerText>Even though JDeveloper marks it as error in page source, it works.

Similar Messages

  • Counting with letters instead of numbers

    hi everybody,
    today I got the requirement to represent the rownums of a recordset (1, 2, 3, 4, 5 and so on) as letters (A, B, C, D, E and so on). First of all I thought there is a database function equal to the to_char function with RN parameter (which is able to convert numbers to roman numbers easily)... but I didn´t find anything.
    So, is there a database function that I haven´t found yet or have you got some custom code for me to realize this?
    ty in advance
    - Oliver

    Hi,
    I don't think it's quite that simple. OP does not want a base-26 number, because there is nothing quite like a 0 in this system, and therefore nothing quite like a leading 0.
    In a base-26 system, you could represent 26 ^2^ distinct numbers with strings up to 2 characters.
    OP wants something where you can represent 26 ^2^ + 26 distinct numbers with strings up to 2 characters: 26 numbers with 1-character strings and a completely disjoint set of 26 ^2^ numbers with 2-character strings.
    I think OP needs something more complicated, like this:
    CREATE OR REPLACE FUNCTION to_abc
    (      in_num       IN        PLS_INTEGER               -- Number to be converted
    RETURN     VARCHAR2
    DETERMINISTIC
    IS
         in_num_26     PLS_INTEGER    := MOD (in_num, 26);
         rest          PLS_INTEGER;
         return_txt     VARCHAR2 (30);
    BEGIN
         IF  in_num IS NULL
         THEN
              RETURN     NULL;
         ELSIF  in_num <= 0
         THEN
              RETURN  '-';
         END IF;
         return_txt := CHR ( 64 + CASE
                             WHEN  in_num_26 = 0
                             THEN  26
                             ELSE  in_num_26
                                  END
         rest := CEIL (in_num / 26);
         IF  rest = 1
         THEN
              RETURN     return_txt;
         ELSE
              RETURN  to_abc (rest - 1) || return_txt;
         END IF;
    END     to_abc;Test script (including your base26 function, for comparison):
    COLUMN     base26          FORMAT     A10
    COLUMN     right_txt     FORMAT     A10
    COLUMN     to_abc          FORMAT     A10
    SET     NULL     "[NULL]"
    WITH test_nums     AS
         SELECT     0 AS n,     '-' AS right_txt     FROM dual     UNION ALL
         SELECT     1,        'A'               FROM dual     UNION ALL
         SELECT     10,        'J'               FROM dual     UNION ALL
         SELECT     26,        'Z'               FROM dual     UNION ALL
         SELECT     27,        'AA'               FROM dual     UNION ALL
         SELECT     28,        'AB'               FROM dual     UNION ALL
         SELECT     52,        'AZ'               FROM dual     UNION ALL
         SELECT     53,        'BA'               FROM dual     UNION ALL
         SELECT     78,        'BZ'               FROM dual     UNION ALL
         SELECT     79,        'CA'               FROM dual     UNION ALL
         SELECT     702,        'ZZ'               FROM dual     UNION ALL
         SELECT     703,        'AAA'               FROM dual     UNION ALL
         SELECT     1404,       'BAZ'               FROM dual     UNION ALL
         SELECT     1405,       'BBA'               FROM dual     UNION ALL
         SELECT     18278,     'ZZZ'               FROM dual     UNION ALL
         SELECT     18279,     'AAAA'               FROM dual     UNION ALL
         SELECT     18280,     'AAAB'               FROM dual     UNION ALL
         SELECT     NULL,     NULL               FROM dual
    SELECT     n
    ,     to_abc (n)     AS to_abc
    ,     right_txt
    ,     CASE
              WHEN  NVL (to_abc (n), '??') =
                    NVL (right_txt,  '??')
              THEN  ' '
              ELSE  '<== WRONG!'
         END             AS flag
    ,     base26 (n)     AS base26
    FROM     test_nums
    ORDER BY  n
    ;Results of test script:
    .        N TO_ABC     RIGHT_TXT  FLAG       BASE26
             0 -          -                     [NULL]
             1 A          A                     a
            10 J          J                     j
            26 Z          Z                     aa
            27 AA         AA                    aa
            28 AB         AB                    ab
            52 AZ         AZ                    ba
            53 BA         BA                    ba
            78 BZ         BZ                    ca
            79 CA         CA                    ca
           702 ZZ         ZZ                    aaa
           703 AAA        AAA                   aaa
          1404 BAZ        BAZ                   bba
          1405 BBA        BBA                   bba
         18278 ZZZ        ZZZ                   aaaa
         18279 AAAA       AAAA                  aaaa
         18280 AAAB       AAAB                  aaab
    [NULL]     [NULL]     [NULL]                [NULL]

  • Keypad displays letters instead of numbers

    I'm trying to input my WPA key for wireless setup.  When I enter it, only letters show up and I'm unable to connect.

    Try holding down the Fn key and tap NumLock, see if this works ?
    If my reply was helpful please click the "Kudos" star.
    If your problem is solved please click the "Accept as Solution" button

  • Looping through letters instead of numbers

    I need to create an array of strings containing everything from A100 to X999.  I tried looping through letters but I don't think it can be done
    var arrayAct = new Array();
      for (i = "A"; i <= "X"; i++){
       for (i2 = 100; i2 <= 999; i2++){
        arrayAct.push(String(i+i2));

    excellent.  Final code is working:
    var arrayAct = new Array();
      for (i = "A".charCodeAt(0); i <= "X".charCodeAt(0); i++){
       for (i2 = 100; i2 <= 999; i2++){
        arrayAct.push(String.fromCharCode(i)+String(i2));

  • How to dial telephone numbers which have letters instead of digits?

    I'm new to Blackberry products & just bought a 8330 curve.  Unlike my other smartphones which had the option of a dial key pad, the Curve appears to have forgotten to include one.  When a telephone number is spelled out with letters instead of digits, how do I dial it?  For example: for my pharmacy refills I would dial 1-123-345-DRUG  or when calling a company after hours and reach its automated answer system which prompts you to key-in the party that you are looking for their last 4 letters of their name.  How do you do it.  Help.

    Hi and welcome to the forums!
    You can enter the alpha chacratars using the alt shift for nummerics.
    For example: 1-800-(alt-shift) -IFlYSWA
    The same applys when you are asked for alpha characters as in your example
    of search by person's name.
    Thanks,
    Please remember to resolve your thread. Put the check mark in the green box that contained your answer! Thanks
    Message Edited by Bifocals on 11-24-2008 06:45 PM
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • When I try to share a Numbers spreadsheet with other Mac users, (via iMessages) it doesn't open on Numbers app but instead on Numbers for iCloud beta, on their browser.

    When I try to share a Numbers spreadsheet with other Mac users, (via iMessages) it doesn't open on Numbers app but instead on Numbers for iCloud beta, on their browser. and worse all the letters appear out of format and unreadable.
    Is there any option that i'm getting wrong
    How can we solve this.
    Usualy we use Google drive documents to share some spreadsheets, but we wanted to share the same document with numbers (that's much better) but it doesn't work as easily as in google drive and doesn't even remotely works how it was supposed.

    When I try to share a Numbers spreadsheet with other Mac users, (via iMessages) it doesn't open on Numbers app but instead on Numbers for iCloud beta, on their browser. and worse all the letters appear out of format and unreadable.
    Don't know why those letters wouldn't display properly; maybe something to do with their settings at Safari > Preferences > Advanced > Default Encoding or similar setting in whatever browser they are using. But it's really easy for them to download the document via the "wrench" in the Numbers for iCloud menu. Then they can open it in the Numbers app.
    For "real-time" collaboration, I think you all need to be accessing Numbers for iCloud via the browser.
    SG

  • How to change the color of letters instead of highlight the text when compare two documents

    Hello!!
    I have the Adobe Acrobat 9 Pro (Versión 9.0.0) and I need to compare two documents, but I want to show the diferences changing  the color of letters instead of highlight the text with any color. My boss tell me that other Acrobat version have this option, but I couldn't find it in this version.
    Could you help me on this topic??
    Thanks

    Hello!!
    I have the Adobe Acrobat 9 Pro (Versión 9.0.0) and I need to compare two documents, but I want to show the diferences changing  the color of letters instead of highlight the text with any color. My boss tell me that other Acrobat version have this option, but I couldn't find it in this version.
    Could you help me on this topic??
    Thanks

  • My numpad won't work. Instead of numbers, my cursor just moves slightly.

    my numpad won't work. there's a beep when i hit numlock and instead of numbers, my cursor just moves slightly. i figure it's something simple, but i'm not sure how to fix it.

    it's a mac mini with 10.5.6 on it. the keyboard is actually i think intended for a pc, but it worked fine for the mac. i also had a legit apple keyboard that worked fine as well. i think that i may have accidentally tweaked the preferences somehow, and it disabled my num lock.

  • Wired letters instead of hebrew

    We wrote a servlet that prints letters in different languages. In order to print the letters, we use:
    PrintWriter out = response.getWriter();
    out.println(letters);
    When we runs the servlet, the servlet prints wired letters instead of hebrew:
    for example:
    =?windows-1255?Q?=EE=...
    the problem is that we need to read the letters that was printed with other program. So, instead to read the hebrew letters, it read wired things.
    How do we make the servlet prints hebrew??
    (we using hebrew and english letters)
    please help us.
    thanks, Naor and Shay.

    It depends on the data and encoded data and the encoding used for output.
    In jsp, you can use <%@page %> to specify the charset (UTF-8) and then set the locale (Hebrew).
    Example jsp file:
    <%@ page contentType="text/html; charset=UTF-8"%>
    <%@ page import="java.util.*"%>
    <%
    String hebrewString = ...... the hebrew string, eg: you get this from database, etc .... ;
    Locale locale = ..... Hebrew locale instance, check it at java.util.Locale javadoc ....;
    response.setLocale(locale);
    %>
    <HTML>
    <%=hebrewString%>
    </HTML>
    If this prints wrongly, then either you use wrong charset/encoding or the hebrew string is not constructed properly (eg: your database doesn't support UTF-8, so when you save the data previously, the string was actually corrupted, etc).
    If you can you write hebrew, you can make it straight like this:
    <%@ page contentType="text/html; charset=UTF-8"%>
    <%@ page import="java.util.*"%>
    <%
    Locale locale = ..... Hebrew locale instance, check it at java.util.Locale javadoc ....;
    response.setLocale(locale);
    %>
    <HTML>
    .. Barukh Haba B'shem Adonai (in hebrew script) ..
    </HTML>
    You may use richedit or IDE which support UTF-8 ( not ANSI! ) to create the jsp file. ANSI editor which will corrupt the text you entered.
    In XP, the notepad for microsoft is able to save the text using UTF-8, this editor can be used safely.
    By default, IE have encoding for Hebrew, so it should show up correctly. If you're using linux/unix or different browser, perhaps you need to download the encoding first to be able to display correctly.
    If you don't know how to write hebrew, go to any hebrew website, copy some text and paste it in UTF-8 editor. If you see the word correctly pasted, then it supports UTF-8. Then, you can create the JSP file I mentioned above.
    rgds,
    Alex

  • Midnight C.: two ways of launch, one - letters instead of lines. Why?

    I may launch Midnight Commander in a three ways. Two of them are OK. But the third will bring drawing borders with letters instead of lines.
    I'm using LXTerminal (I think it doesn't matter). Below there is screenshot with launch results.
    Launch commands:
    1) In terminal as a user :
    mc
    2) In terminal, becoming root at first:
    su -
    mc
    3) Launch button from a panel, launch as a user:
    lxterminal --command="sudo su -l root -c /usr/bin/mc"
    The first two ways are OK, third way will bring "broken" lines. Give me please an idea of what to search. Or how to fix broken lines?
    Last edited by Stack (2012-12-18 12:09:39)

    Thank you. 'sudo /usr/bin/mc' did the trick.
    In both cases lines are OK.
    2013-03-03
    It was locale setup issue for a user's session - no local proper set up was done. There was related issue. The bug was absence of locale environment setup for VNC sessions. I.e. a file to be launched along with VNC server's wake up staff must have proper "export" for LC_* and LANG variables. In my system the file is '~/.vnc/xstartup'. I'm shure there are other, may be more elegant, ways to set up system wide wanted locale settings, to be picked up automaticaly by a VNC server for every user. May be '~/.vnc/xstartup' code may be an implementation of another than mine approach.
    Last edited by Stack (2013-03-03 07:00:47)

  • HT4515 How do I use the phone keypad to enter letters from a password instead of numbers  when prompted by an automated system?

    All help welcome thanks!

    BibiQueen wrote:
    I'm pressing numbers twice, holding them down, and otherwise trying to type a letter and it's not working.
    Well, you don't do that. Example: You want to dial SPAM, all you do is press 7726, that's it. The system will know you mean SPAM.

  • Random letters to random numbers in the code template?

    I'd like to change the random letters of the code template in Motion 5 to be random numbers.
    PLATFORM: quad 2.9 macpro, Mavericks, 8 GB RAM, Motion 5.

    type the number you want. I highly recommend a monospace font (or at least a font with monospace number characters -- there are a few...)
    Add > Behaviors > Text Animation
    Parameter Add > Format > Character Offset
    Set Character Offset to 18 (seems to work well.)
    Character Set: Preserve Case & Digits
    Adjust Spread to taste.
    Consider Direction > Random

  • Numbers Line Graph is more annoying than Miley Cyrus

    Hello and thanks for taking time to read and answer my question.  So I have a science fair project coming up and numbers is being very annoying.  My experiment is testing the affect of temperature on the effectiveness of magnets.  My table looks like this: 
    Magnet 1
    Magnet 2
    Magnet 3
    Magnet 4
    Magnet 5
    Average
    74 Degrees
    40g
    42g
    50g
    27g
    38g
    39.4
    200 Degrees
    28g
    25g
    35g
    46g
    38g
    34.4
    250 Degrees
    62g
    39g
    10g
    53g
    29g
    38.6
    300 Degrees
    34g
    19g
    36g
    23g
    41g
    30.6
    350 Degrees
    26g
    21g
    17g
    36g
    37g
    27.4
    All I want to do is make a simple line graph that will show the correlation (or lack of one) However, when I try to make it into a graph, I keep either getting no lines at all or only the line for the average.  Why is this?  What am I doing wrong?  Help is greatly appreciated.
    Thanks so much,
    Colton
    I'm using numbers 3.1 by the way.

    Hi Colton,
    "I keep either getting no lines at all or only the line for the average.  Why is this? "
    It's because the column labeled Average is the only one containing numbers. Appending the g or " Degrees" forces Numbers to regard the values in the other columns as Text, which has no numerical value, and can't be graphed.
    With the text stripped from those numerical values you can produce either of these two graphs. See the notes below regrding the major differences.
    Scatter chart with connected points
    Line chart
    Cosmetically, the line graph appears with thicker lines connecting the data points, and with all symbols set to open circles. I thickened the connecting lines on the scatter chart to make them more visible, and made the Average line about 40% thicker than the others. No changes were made to the lines on the line chart.
    The legend for both (Magnet 1, Magnet 2, etc.) appears as a horizontal line (or lines) of text. Selecting the box, then dragging either handle toward the other forces the labels into a vertical stack, which can then be moved to a visually better position.
    The main functional difference between the two types is in the purpose of the X axis.
    In the scatter chart, both X and Y axes are Value axes—the position of each data point is determined vertically by its Y value and horizontally by its X value.
    The Line chart is a Category chart. Category charts have one Value axis (here the Y axis) and one Category axis (here the X axis). Categories are equally spaced along the Category axis, and the data points' vertical position(in this example) is determined by the Y value of the point.
    In your case, the difference can be seen in the (horizontal) distance between the first two samples in each series compared to the (horizontal) distance between other ajacent pairs in the same series. In the Line chart, these distances are all the same. In the Scatter chart the first pair (74° and 200°) are more widely separated than the others (each 50° higher than the temperature before it).
    In cases where you are trying to show a relationship (or lack of relationship) between two sets of values (speed vs braking distance, temperature vs volume, etc.) a scatter chart usually gives a better representation.
    Practical note: Values must be placed in non-Header rows and columns. Labels, including Category labels, must be placed in Header Rows or Header columns to be picked up by the chart. The formatting of the pasted data in your initial post indicates the temperatures are in a Header column. The column labels are (and should be) in a Header row.
    Good luck with your project!
    Regards,
    Barry
    PS: You might want to check the meanings of "affect" and "effect" before commiting yourself to either on your display and in your report.
    PPS to Yellowbox: HI Ian. Looks like you got started earlier and/or wrote faster thn I did! Something odd happened in the example in your first post. The category labels have been offset one cata set to the right, and there's no 350.
    B

  • I get a full keyboard instead of numbers when I log in. Help!

    I went to log into my ipad, and instead of a number pad I got a full keyboard instead.  No matter what I try, I can't get into my ipad now. It won't take my password.  Does anyone know what to do?

    tried that... it doesn't work.  It takes me back to the full keyboard version of numbers instead of the pad, and doesn't take my password.  I just tried to reset from itunes and its reloading the software.  I'll see how that goes.  Thanks, though!

  • Getting junk letters instead of photo in an email.

    hi all
    i am trying to send an email via gmail.com i am able to send an email but when i try to
    send attachment so i am getting strange texts instead of photo
    its not displaying photo but there is different format text is displaying in my box.
    here is the result.
    also getting this error but i am able to send email.
    ERROR at line 1:
    ORA-20000: Failed to send mail due to the
    following error: ORA-29277: invalid SMTP operation
    ORA-06512: at "MAIL.MAHI", line 159
    ORA-06512: at line 2===============================================
    --BACKUP.SECBOUNDContent-
    Type: application/octet-streamContent-Disposition:
    attachment; filename="g.gif"Content-Transfer-Encoding: base64
    Qk2O5QgAAAAAADYAAAAoAAAAwgIAABMBAAABABgAAAAA
    AFjlCAAAAAAAAAAAAAAAAAAAAAAAhNWuhNWuhNWuhNWu
    hNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuh
    NWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNW
    uhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhN
    WuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuh
    NWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWu
    hNWuhNWuhNWuhNWuhNWuhNWuhNWuhN
    WuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuh
    NWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNW
    uhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhN
    WuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNWuhNand here the link which is i followed to use with my codes....
    Re: Sending UTL_SMTP mail with single jpg attachment issue
    create or replace package body Mahi
           is
              -- Write a MIME header
              procedure write_mime_header (
                  p_conn in out nocopy utl_smtp.connection
               , p_name in varchar2
                , p_value in varchar2
               is
              begin
                utl_smtp.write_data ( p_conn
                                     , p_name || ': ' || p_value || utl_tcp.crlf
             end;
             procedure mail (
                p_sender in varchar2
              , p_recipient in varchar2
               , p_subject in varchar2
               , p_message in varchar2
              is
                l_conn           utl_smtp.connection;
                nls_charset    varchar2(255);
               v_src_loc  BFILE := BFILENAME('BACKUP', 'Logon.jpg');
               --v_src_loc BLOB;
          l_buffer   RAW(54);
          l_amount   BINARY_INTEGER := 54;
          l_pos      INTEGER := 1;
          l_blob     BLOB := EMPTY_BLOB;
          l_blob_len INTEGER;
         v_amount   INTEGER;
                  v_fname VARCHAR2(50);
         CURSOR img_cur IS SELECT photo_name,photo
      FROM temp_photo;
        --crlf  varchar2(2) := chr(10)||chr(13);
    PROCEDURE send_header(pi_name IN VARCHAR2, pi_header IN VARCHAR2) AS
       BEGIN
          UTL_SMTP.WRITE_DATA(l_conn,
                              pi_name || ': ' || pi_header || UTL_TCP.CRLF);
       END;
             begin
                -- get characterset
                select value
                into   nls_charset
                from   nls_database_parameters
                where  parameter = 'NLS_CHARACTERSET';
                select
                photo into v_src_loc from
                temp_photo
                where id=1;
                DBMS_LOB.OPEN(v_src_loc, DBMS_LOB.LOB_READONLY); --Read the file
         DBMS_LOB.CREATETEMPORARY(l_blob, TRUE); --Create temporary LOB to store the file.
         v_amount := DBMS_LOB.GETLENGTH(v_src_loc); --Amount to store.
         DBMS_LOB.LOADFROMFILE(l_blob, v_src_loc, v_amount); -- Loading from file into temporary LOB
         --DBMS_LOB.COPY(l_blob, v_src_loc, v_amount);
         l_blob_len := DBMS_LOB.getlength(l_blob);
               -- establish connection and autheticate
               l_conn   := utl_smtp.open_connection (g_smtp_host, g_smtp_port);
                utl_smtp.ehlo(l_conn, g_smtp_domain);
                 utl_smtp.command(l_conn, 'auth login');
                 utl_smtp.command(l_conn,utl_encode.text_encode('[email protected]', nls_charset, 1));
                utl_smtp.command(l_conn, utl_encode.text_encode('xxxxx', nls_charset, 1));
                 -- set from/recipient
                  utl_smtp.command(l_conn, 'MAIL FROM: <'||p_sender||'>');
                 utl_smtp.command(l_conn, 'RCPT TO: <'||p_recipient||'>');
                -- write mime headers
                 utl_smtp.open_data (l_conn);
                 write_mime_header (l_conn, 'From', p_sender);
                write_mime_header (l_conn, 'To', p_recipient);
                write_mime_header (l_conn, 'Subject', p_subject);
                 write_mime_header (l_conn, 'Content-Type', 'text/plain; charset=us-ascii');
                 write_mime_header (l_conn, 'X-Mailer', g_mailer_id);
                 utl_smtp.write_data (l_conn, UTL_TCP.CRLF);
                 UTL_SMTP.WRITE_DATA(l_conn,
                             'MIME-Version: 1.0' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Type: multipart/mixed; ' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             ' boundary= "' || 'BACKUP.SECBOUND' || '"' ||
                             UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
                 -- write message body
                utl_smtp.write_data (l_conn, p_message);
                OPEN img_cur;
      LOOP
      FETCH img_cur INTO v_fname,l_blob;
    end loop;
    close img_cur;
                UTL_SMTP.WRITE_DATA(l_conn,
                             '--' || 'BACKUP.SECBOUND' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Type: text/plain;' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             ' charset=US-ASCII' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,  p_message || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             '--' || 'BACKUP.SECBOUND' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Type: application/octet-stream' ||
                             UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Disposition: attachment; ' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             ' filename="' || 'gpg.jpg' || '"' || --My filename
                             UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Transfer-Encoding: base64' || UTL_TCP.CRLF);
        UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
      /* Writing the BLOL in chunks */
        WHILE l_pos < l_blob_len LOOP
          DBMS_LOB.READ(l_blob, l_amount, l_pos, l_buffer);
          UTL_SMTP.write_raw_data(l_conn,
                                  UTL_ENCODE.BASE64_ENCODE(l_buffer));
          UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
           l_buffer := NULL;
           l_pos    := l_pos + l_amount;
         END LOOP;
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
        -- Close Email
        UTL_SMTP.WRITE_DATA(l_conn,
                             '--' || 'BACKUP.SECBOUND' || '--' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             UTL_TCP.CRLF || '.' || UTL_TCP.CRLF);
                             UTL_SMTP.CLOSE_DATA(l_conn);
                             utl_smtp.close_data (l_conn);
         UTL_SMTP.QUIT(l_conn);
         DBMS_LOB.FREETEMPORARY(l_blob);
         DBMS_LOB.FREETEMPORARY(l_blob);
         DBMS_LOB.FILECLOSE(v_src_loc);
                    -- end connection
                utl_smtp.quit (l_conn);
                        exception
                 when others
                 then
                   begin
                      utl_smtp.quit(l_conn);
                    exception
                      when others then
                       null;
                   end;
                   raise_application_error(-20000,'Failed to send mail due to the
    following error: ' || sqlerrm);
    DBMS_LOB.FREETEMPORARY(l_blob);
    DBMS_LOB.FREETEMPORARY(l_blob);
          DBMS_LOB.FILECLOSE(v_src_loc);
         raise;
             end;
          end;
          commit;Note:- i am using Stunnel,Oracle Database 11g R2 and OS is Linux...
    I installed Linux on virtualBox.
    please suggest me why i am getting strange text instead of photo?
    if my code is wrong plz correct for me..
    thanks in advance...
    Mehwish
    Student.
    Edited by: Mehwish on Apr 15, 2011 10:57 PM

    Your codes are very nice and easy to use but i am unlucky and i am not able to send  attachment
    before i was not able to send even junk  text of photo but after using u r code
    i am able to send that and i am near to solve my problem because of your nice guide and codes...
    create directory backup as  '/u01/dump';
    grant read,write on directory backup to mail,scott;
    and goes this instead of picture.
    Hi Meh --BACKUP.SECBOUNDContent-Type: application/octet-streamContent-Disposition:
    attachment; filename="gpg.jpg"Content-Transfer-Encoding: base64 /9j/4AAQ
    SkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPgAA/+
    4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAQEBgQEBgkGBQYJCgcGBgcKCwkJCg
    kJCw8LDAwMDAsPDA0ODg4NDBERExMRERoZGRkaHR0dHR0dHR0dHQEGBwcMCw
    wWDw8WGRQQFBkdHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dH
    R0dHR0dHR0dHR0dHR0d/8AAEQgA+wG0AwERAAIRAQMRAf/EAKQAAAICAwEBAQ
    AAAAAAAAAAAAECAAMFBgcECAkBAQEAAwEBAQAAAAAAAAAAAAABAgMEBQYHE
    AABAwIEAwQGCAMFBgYDAAABAAIDEQQhMRIFQRMGUWEiB3GBoTJCFJGxwVJiI
    xUIkjMk0XKCokPh8cJT
    and i tried to use this code now.
    create or replace package body mahi
           is
              -- Write a MIME header
              procedure write_mime_header (
                  p_conn in out nocopy utl_smtp.connection
               , p_name in varchar2
                , p_value in varchar2
               is
              begin
                utl_smtp.write_data ( p_conn
                                     , p_name || ': ' || p_value || utl_tcp.crlf
             end;
             procedure mail (
                p_sender in varchar2
              , p_recipient in varchar2
               , p_subject in varchar2
               , p_message in varchar2
              is
                l_conn           utl_smtp.connection;
                nls_charset    varchar2(255);
               v_src_loc  BFILE := BFILENAME('BACKUP', 'Logon.jpg');
               --v_src_loc BLOB;
          l_buffer   RAW(54);
          l_amount   BINARY_INTEGER := 54;
          l_pos      INTEGER := 1;
          l_blob     BLOB := EMPTY_BLOB;
          l_blob_len INTEGER;
         v_amount   INTEGER;
                  v_fname VARCHAR2(50);
        --crlf  varchar2(2) := chr(10)||chr(13);
    PROCEDURE send_header(pi_name IN VARCHAR2, pi_header IN VARCHAR2) AS
       BEGIN
          UTL_SMTP.WRITE_DATA(l_conn,
                              pi_name || ': ' || pi_header || UTL_TCP.CRLF);
       END;
             begin
                -- get characterset
                select value
                into   nls_charset
                from   nls_database_parameters
                where  parameter = 'NLS_CHARACTERSET';
                select
                photo into v_src_loc from
                temp_photo
                where id=1;
                DBMS_LOB.OPEN(v_src_loc, DBMS_LOB.LOB_READONLY); --Read the file
         DBMS_LOB.CREATETEMPORARY(l_blob, TRUE); --Create temporary LOB to store the file.
         v_amount := DBMS_LOB.GETLENGTH(v_src_loc); --Amount to store.
         DBMS_LOB.LOADFROMFILE(l_blob, v_src_loc, v_amount); -- Loading from file into temporary LOB
         --DBMS_LOB.COPY(l_blob, v_src_loc, v_amount);
         l_blob_len := DBMS_LOB.getlength(l_blob);
               -- establish connection and autheticate
               l_conn   := utl_smtp.open_connection (g_smtp_host, g_smtp_port);
                utl_smtp.ehlo(l_conn, g_smtp_domain);
                 utl_smtp.command(l_conn, 'auth login');
                 utl_smtp.command(l_conn,utl_encode.text_encode('[email protected]', nls_charset, 1));
                utl_smtp.command(l_conn, utl_encode.text_encode('xxxxx', nls_charset, 1));
                 -- set from/recipient
                  utl_smtp.command(l_conn, 'MAIL FROM: <'||p_sender||'>');
                 utl_smtp.command(l_conn, 'RCPT TO: <'||p_recipient||'>');
                -- write mime headers
                 utl_smtp.open_data (l_conn);
                 write_mime_header (l_conn, 'From', p_sender);
                write_mime_header (l_conn, 'To', p_recipient);
                write_mime_header (l_conn, 'Subject', p_subject);
                 write_mime_header (l_conn, 'Content-Type', 'text/plain; charset=us-ascii');
                 write_mime_header (l_conn, 'X-Mailer', g_mailer_id);
                 utl_smtp.write_data (l_conn, UTL_TCP.CRLF);
                 UTL_SMTP.WRITE_DATA(l_conn,
                             'MIME-Version: 1.0' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Type: multipart/mixed; ' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             ' boundary= "' || 'BACKUP.SECBOUND' || '"' ||
                             UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
                 -- write message body
                utl_smtp.write_data (l_conn, p_message);
                UTL_SMTP.WRITE_DATA(l_conn,
                             '--' || 'BACKUP.SECBOUND' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Type: text/plain;' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             ' charset=US-ASCII' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,  p_message || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             '--' || 'BACKUP.SECBOUND' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Type: application/octet-stream' ||
                             UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Disposition: attachment; ' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             ' filename="' || 'gpg.jpg' || '"' || --My filename
                             UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             'Content-Transfer-Encoding: base64' || UTL_TCP.CRLF);
        UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
      /* Writing the BLOL in chunks */
        WHILE l_pos < l_blob_len LOOP
          DBMS_LOB.READ(l_blob, l_amount, l_pos, l_buffer);
          UTL_SMTP.write_raw_data(l_conn,
                                  UTL_ENCODE.BASE64_ENCODE(l_buffer));
          UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
           l_buffer := NULL;
           l_pos    := l_pos + l_amount;
         END LOOP;
         UTL_SMTP.WRITE_DATA(l_conn, UTL_TCP.CRLF);
        -- Close Email
        UTL_SMTP.WRITE_DATA(l_conn,
                             '--' || 'BACKUP.SECBOUND' || '--' || UTL_TCP.CRLF);
         UTL_SMTP.WRITE_DATA(l_conn,
                             UTL_TCP.CRLF || '.' || UTL_TCP.CRLF);
                             UTL_SMTP.CLOSE_DATA(l_conn);
                             utl_smtp.close_data (l_conn);
         UTL_SMTP.QUIT(l_conn);
         DBMS_LOB.FREETEMPORARY(l_blob);
         DBMS_LOB.FREETEMPORARY(l_blob);
         DBMS_LOB.FILECLOSE(v_src_loc);
                    -- end connection
                utl_smtp.quit (l_conn);
                        exception
                 when others
                 then
                   begin
                      utl_smtp.quit(l_conn);
                    exception
                      when others then
                       null;
                   end;
                   raise_application_error(-20000,'Failed to send mail due to the
    following error: ' || sqlerrm);
    DBMS_LOB.FREETEMPORARY(l_blob);
    DBMS_LOB.FREETEMPORARY(l_blob);
          DBMS_LOB.FILECLOSE(v_src_loc);
         raise;
             end;
          end;
          Note:- i m using stunnel and sending email via gmail and my OS is linux and oracle database 11g R2.
    i posted already in my previous post.
    is tthere any format problem?
    and also i am getting this error but i am able to send email which is getting properly in inbox.
    ERROR at line 1:
    ORA-20000: Failed to send mail due to the
    following error: ORA-29277: invalid SMTP operation
    ORA-06512: at "MAIL.Mahi", line 151
    ORA-06512: at line 2

Maybe you are looking for

  • Delete and renameto not working in java

    guys, i have written a java program that reads file1 into temp file and finally writes into another file. program is working fine with no errors, it even reported that the file is deleted. But actually the file was not deleted and renameto was never

  • CALL FUNCTION 'POSTING_INTERFACE_CLEARING'

    请问怎么输入清帐凭证的金额 REPORT ZTETS1 . CALL FUNCTION 'POSTING_INTERFACE_START'      EXPORTING          I_CLIENT           = SY-MANDT          I_FUNCTION         = 'D'         i_group            = space         i_holddate         = space         i_keep        

  • ITS URGENT : chek box in out put list

    Hi all ,   my requirement is i have provided Reject Button in application tool bar  of out put list in  report . when pressing reject button, what r the records selected that can be saved as Reject status . (Table zvendors having field status.)      

  • New machine with Windows 8 ate my bandwith. ( H520s )

    Hello, I purchased a http://www.newegg.com/Product/Product.aspx?Item=N82E16883265288 and while the hardware and everything runs perfect, Windows 8 ate my bandwith up using 500 MBs in 4 hours without getting windows updates (I set those on notify only

  • I lost my iPhoto Library! Can someone help me find it?

    Yesterday, I tried to open iPhoto and received a message stating that my iPhoto Library could not be found and asked if would I like to find it. Yes, I would really like to find it but haven't a clue about how to do so. I hadn't used iPhoto in a week