8 Replies Latest reply: May 3, 2011 2:15 AM by Billy~Verreynne RSS

    Oracle CHR(n) Function

    R. Royal
      I need an Oracle CHR(n) Function to have a BOLD message.

      Have someone any idea?
        • 1. Re: Oracle CHR(n) Function
          riedelme
          Raf Royal wrote:
          I need an Oracle CHR(n) Function to have a BOLD message.
          I do not understand the question.

          CHR() writes a specfic character based on the encoding sequence; for example you could write a newline using CHR(13). It has nothing to do with "BOLD" UNLESS you want to write a bold code for specific device like a printer, in which case you have to use a manual to find what the device recognizes as "BOLD" - possibly more than one character

          Most modern devices and software don't need this encoding and use HTML or XML for special formatting.
          • 2. Re: Oracle CHR(n) Function
            Karthick_Arp
            What do you mean by BOLD message? You mean like BOLD Font?

            If yes then you should know oracle is not a presentation layer tool. You can do such things with oracle.
            • 3. Re: Oracle CHR(n) Function
              6363
              Raf Royal wrote:

              I need an Oracle CHR(n) Function to have a BOLD message.
              What is bold is controlled by the display software. In this forum it is {noformat}*bold*{noformat}, in HTML it is {noformat}<b>bold</b>{noformat} (b in less than greater than parentheses), in RTF it would be something awful like {noformat}{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\{noformat}.

              So what display software are you using and how does it define bold?
              • 4. Re: Oracle CHR(n) Function
                R. Royal
                I'm trying to send mail to Oracle an I'd like to write the message in bold.
                • 5. Re: Oracle CHR(n) Function
                  sb92075
                  I'm trying to send mail to Oracle an I'd like to write the message in bold.
                  my cellphone does not support BOLD type.
                  :-(
                  • 6. Re: Oracle CHR(n) Function
                    6363
                    Raf Royal wrote:

                    I'm trying to send mail to Oracle
                    Oracle will be unlikely to read it.
                    an I'd like to write the message in bold.
                    The mail program I am currently using supports RTF, HTML and plain text. Others like sb92075's cell phone mail support fewer options, and others may support more. Since you don't say what mail program is involved, your best bet would seem to be constructing an HTML mail, much as I dislike it myself, so bold would be {noformat}<{noformat}b{noformat}>{noformat}Bold text here{noformat}<{noformat}/b{noformat}>{noformat}
                    • 8. Re: Oracle CHR(n) Function
                      Billy~Verreynne
                      Raf Royal wrote:
                      I need an Oracle CHR(n) Function to have a BOLD message.
                      Display device?

                      The display renders the output. So it depends on the display device what is required to enabled bold text. If the display device is a web browser, then it will be HTML and the bold text HTML tag needs to be used.

                      If it is for example an ANSI device (like a console running the sqlplus program), then ANSI escape codes need to be used to tell the ANSI device to enable bold (and disable it after the end of the text).

                      I posted a basic example in {message:id=9276344} a while back for how to underline text. For bold text on an ANSI device, your SQL statement needs to include the following CHR() calls:
                      SQL> select chr(27)||'[1;10m'||'This is a test'||chr(27)||'[1;00m' as COL1 from dual;
                      
                      COL1
                      ----------------------
                      This is a test
                      The output will be rendered as:
                      This is a test

                      If you are sending e-mail, then you need to tell the mail reader what renderer to use - and create a Mime body with Mime type HTML in order to use HTML rendering (and thus HTML tags in your mail).